Page 1 of 1

How to convert Datepicker value to js Date() object?

Posted: Thu Sep 17, 2015 7:03 pm
by Dongzhi Yang7528784

Hi Team,

Is there a quick way to convert the value of a datepicker e.g. (9/10/2015) to a Date() object in javascript?

The trick is that datepicker 's value can be in different date formats.

Thanks

Dongzhi


How to convert Datepicker value to js Date() object?

Posted: Fri Sep 18, 2015 6:56 am
by Serhii Kulibaba

Hello Dongzhi,

Please use this JS:
prevar d = new Date($("[name=datepickerName] input").val());/pre

here datepickerName - datepicker's name


How to convert Datepicker value to js Date() object?

Posted: Fri Sep 25, 2015 11:50 pm
by Dongzhi Yang7528784

Thanks, but the format of datepicker component could be different right? I mean e.g. "9/10/2015", how can the new Date() function tell , if it's 9th of October or 10th of September?


How to convert Datepicker value to js Date() object?

Posted: Sat Sep 26, 2015 9:38 pm
by Alena Prykhodko

Dear Dongzhi,

Please search online for suitable solution, custom code is something outside the scope of our standard support.