Dongzhi Yang7528784
Posts: 0
Joined: Mon May 11, 2015 6:28 am

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

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

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

Hello Dongzhi,

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

here datepickerName - datepicker's name

Dongzhi Yang7528784
Posts: 0
Joined: Mon May 11, 2015 6:28 am

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

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?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

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

Dear Dongzhi,

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

Return to “Issues”