fullcalendar - adding current time to ambiguous date using momentjs -
i'm using fullcalendar , need add current time ambiguous date moment in select callback function.
when selecting day in month view, callback function parameters "start" , "end" return ambiguous date (no time) moment. i'm using following add current time date convert moment wonder if proper way it...
if(!start.hastime()){ start = moment(start.format('yyyy-mm-dd'+' '+ moment().format('hh:mm:ss'))); end = moment( end.format('yyyy-mm-dd'+' '+ moment().format('hh:mm:ss'))); } as can see, i'm converting "start" , "end" dates , current time moments strings converting concatenated string moment.
i want make sure moment i'm creating in valid iso 8601 format.
thanks, appreciated.
in official docs says if call format() function date in iso 8601 format. check out: jsfiddle
furthermore, if dont want handle timezones, can use utc() method
Comments
Post a Comment