javascript - Date Object toLocaleString not working properly -
why date , time not work syntax?
<script> date.prototype.addhours = function (h) { this.sethours(this.gethours() + h); return this; }; $(document).ready(function () { $("#countdown").countdown({ date: date.addhours(1).tolocalestring(), format: "on" }, function () { // callback function }); }); </script>
but work fine:
<script> date.prototype.addhours = function (h) { this.sethours(this.gethours() + h); return this; }; $(document).ready(function () { $("#countdown").countdown({ date: "4/5/2014 12:13:16 pm", format: "on" }, function () { // callback function }); }); </script>
the change on date property. fyi
date
constructor, , need new
instance of it
$("#countdown").countdown({ date: (new date()).addhours(1).tolocalestring(), format: "on" },
not sure if matters, note not users same string tolocalestring()
Comments
Post a Comment