File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -458,22 +458,23 @@ module.exports = {
458
458
curr . end = ( curr . datetype === 'date-time' ) ? new Date ( curr . start . getTime ( ) ) : moment . utc ( curr . start ) . add ( 1 , 'days' ) . toDate ( ) ;
459
459
460
460
// If there was a duration specified
461
+ // see RFC5545, 3.3.6 (no year and month)
461
462
if ( curr . duration !== undefined ) {
462
463
const durationUnits =
463
464
{
464
- // Y: 'years',
465
- // M: 'months',
466
465
W : 'weeks' ,
467
466
D : 'days' ,
468
467
H : 'hours' ,
469
468
M : 'minutes' ,
470
469
S : 'seconds'
471
470
} ;
472
471
// Get the list of duration elements
473
- const duration = curr . duration . match ( / - ? \d { 1 , 10 } [ Y M W D H S ] / g) ;
472
+ const duration = curr . duration . match ( / - ? \d { 1 , 10 } [ W D H M S ] / g) ;
474
473
475
474
// Use the duration to create the end value, from the start
476
- let newEnd = moment . utc ( curr . start ) ;
475
+ const startMoment = moment . utc ( curr . start ) ;
476
+ let newEnd = startMoment ;
477
+
477
478
// Is the 1st character a negative sign?
478
479
const indicator = curr . duration . startsWith ( '-' ) ? - 1 : 1 ;
479
480
You can’t perform that action at this time.
0 commit comments