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

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -