Navigation
Recherche
|
JavaScript dates and times will get easier soon
samedi 1 février 2025, 00:10 , par InfoWorld
Web developers will soon find it easier to work with dates and times in JavaScript, thanks to emerging browser support for JavaScript’s Temporal object, according to Mozilla.
Implementations of the new Temporal object have begun shipping in experimental releases of browsers, said Brian Smith, staff technical writer on the MDN Web Docs team at Mozilla, in a blog post on January 23. Applications relying on scheduling, time-sensitive data, or internationalization can use Temporal for precise, consistent dates, times, calendars, and durations. However, stable, cross-browser support for Temporal has not been reached yet, and changes may be made as implementations develop, Smith said. Mozilla’s Firefox browser appears to have the most-mature implementation at this juncture, with support being built into the Nightly version behind the behind the javascript.options.experimental.temporal preference, he said. The main browser bugs that track Temporal implementations include Firefox, Safari and Chrome. JavaScript Temporal was designed as a full replacement for the JavaScript Date object, to make date and time management reliable and predictable, Smith said. The date object has supported a user’s local time and UTC, with no time zone support. It also has had unreliable parsing and Date is mutable, a situation that can produce hard-to-trace bugs, according to Smith. Also, there are problems with Date across daylight savings time and historical calendar changes. By contrast, Temporal offers support for time zone and calendar representations and many built-in methods for conversions, comparisons, computations, formatting, and other capabilities. Key concepts in Temporal include unique points in history, wall clock times, and durations. With experimental implementations landing, it is a good time to try out Temporal and become familiar with it, said Smith. MDN has online documentation on Temporal.
https://www.infoworld.com/article/3814766/javascript-dates-and-times-will-get-easier-soon.html
Voir aussi |
56 sources (32 en français)
Date Actuelle
sam. 1 févr. - 05:57 CET
|