mde / timezone-js

DEPRECATED: Timezone-enabled JavaScript Date object. Uses Olson zoneinfo files for timezone data.
824 stars 183 forks source link

toLocaleDateString, toLocaleTimeString, toLocaleString function empty #55

Closed pixelfreak closed 11 years ago

pixelfreak commented 11 years ago

Why are the functions toLocaleDateString, toLocaleTimeString, toLocaleString empty?

mde commented 11 years ago

Because those defer to the local OS, so don't yield consistent results. Whenever I need to format datetimes for human-readability, I use something like utilities.date.strftime: https://github.com/mde/utilities/blob/master/lib/date.js These date utilities were originally written to work with TimezoneJS.

pixelfreak commented 11 years ago

Makes sense, thanks. I am already using Moment.js for human readable dates, is there a problem as far as you know if I use this framework in conjunction with timezone-js?

mde commented 11 years ago

TimezoneJS date-objects respond to the same setter/getter methods that normal JS Dates do, so if Moment uses those, it ought to be fine. Only way to know for sure is to try it and see though.

On Tue, Jan 29, 2013 at 11:17 AM, William Khoe notifications@github.comwrote:

Makes sense, thanks. I am already using Moment.js for human readable dates, is there a problem as far as you know if I use this framework in conjunction with timezone-js?

— Reply to this email directly or view it on GitHubhttps://github.com/mde/timezone-js/issues/55#issuecomment-12852243.

pixelfreak commented 11 years ago

Tested. Seems to be working fine. Thanks!