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

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -