javascript - bootstrap getDate returns different from the obvious -


i not understand happening.

here how render html in .cshtml view

<input class="date input-sm" type="text" id="certificatefrom" value="@(new datetime(datetime.today.year, 1, 1).toshortdatestring())"> 

and here html itself:

<input class="date input-sm" type="text" id="certificatefrom" value="1.1.2015 г."> 

this what's bothering me

$('#certificatefrom').val() 

"1.1.2015 г."

$('#certificatefrom').data('datepicker').viewdate 

thu jan 01 2015 00:00:00 gmt+0200 (fle standard time)

$('#certificatefrom').data('datepicker').getdate()   //$('#certificatefrom').datepicker('getdate') returns same result 

wed dec 31 2014 22:00:00 gmt+0200 (fle standard time)

q: why happening? , how correctly js date object


Comments