You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 15, 2020. It is now read-only.
Got across this issue when trying to set a VALARM with a trigger at the time of the event (in other words, with a zero duration).
When I printed the resulting calendar, I noticed that TRIGGER property was 'P', instead of 'P0D'.
I have been looking at the code and it's not a difficult issue to tackle. However, I have seen that you are currently making all the calculations manually, have you taken a look at the awesome MomentJS library?
If I am making no mistakes, at least DURATION.format method from lib/types can be replaced with moment.duration(value, 'seconds').toJSON()
_UPDATE_
From iCalendar RFC 5545:
"Note that unlike [ISO.8601.2004], this value type doesn't support the "Y" and "M" designators to specify durations in terms of years and months."
Taking into account that moment.duration.toJSON strictly follows ISO8601, then no, MomentJS its not a DIRECT replacement for this method. However, moment.duration object (and the MomentJS library in general) can still reduce A LOT of code.
The text was updated successfully, but these errors were encountered:
Got across this issue when trying to set a VALARM with a trigger at the time of the event (in other words, with a zero duration).
When I printed the resulting calendar, I noticed that TRIGGER property was 'P', instead of 'P0D'.
I have been looking at the code and it's not a difficult issue to tackle. However, I have seen that you are currently making all the calculations manually, have you taken a look at the awesome MomentJS library?
From http://momentjs.com/docs/#/durations/as-json/:
"When serializing a duration object to JSON, it will be be represented as an ISO8601 string."
If I am making no mistakes, at least DURATION.format method from lib/types can be replaced with moment.duration(value, 'seconds').toJSON()
_UPDATE_
From iCalendar RFC 5545:
"Note that unlike [ISO.8601.2004], this value type doesn't support the "Y" and "M" designators to specify durations in terms of years and months."
Taking into account that moment.duration.toJSON strictly follows ISO8601, then no, MomentJS its not a DIRECT replacement for this method. However, moment.duration object (and the MomentJS library in general) can still reduce A LOT of code.
The text was updated successfully, but these errors were encountered: