Hi all!
Is it possible to add n minutes to .Date
—for a calendar function.
This is what I tried to do:
{{ .Date.Add(time.Hour 2) }}
Thank you
Hi all!
Is it possible to add n minutes to .Date
—for a calendar function.
This is what I tried to do:
{{ .Date.Add(time.Hour 2) }}
Thank you
Untested, but perhaps…
{{.Date.AddDate 0 0 2 }}
Correction, I believe that AddDate is Y M H, so you could try a fraction perhaps? Not at my computer right now but will test shortly…
Thank you very much.
Yes, it is Y M D.
A fraction does not seem possible here.
Still no success here. I guess, I tried every combination possible
Adding hours or minutes seems difficult—unlike Y, M or D.
Has anyone an idea?
Gosh! The following code ist most ugly and not a definite solution:
{{ add .Date.Hour 1 }}:{{ add .Date.Minute 30 }}
Only for events starting before 22:30, of course.
Just no success with .Date.Add
and time.duration
.
So are you saying this does or does not get you what you want in your final output?
Well, what I really need is this:
add “n” minutes to any .Date
, respecting change of date including leapyear and everything.