![]() ![]() Once we compiled our list of options, we got the bundle size for each of the packages including all required plugins/addons to support timezones and locales. Keep in mind that there was a time constraint, so we couldn’t examine every option. We started with recommendations from the moment deprecation guide and tossed in some fan favorites to make sure we made the best choice we could. With that in mind let’s check out the contenders. Localization, timezone, and offset support are all critical. The other major consideration is that I work for an international company with clients in 13 different languages, and countless timezones. This helps ensure the only changes between staging and production are basic configuration values. The TL DR here is that we deliver fully qualified versions of dependencies and built assets. My team chooses to deploy our web apps following the Immutable Web Apps philosophy. Moment offers a lot of functionality, and when combined with moment-timezone, the challenge is even greater. In the case of moment, this is no trivial task. The start of any journey to replace a deprecated library has to begin with finding a replacement. The old king is dead, but who’s the new king? With that I began a journey during a Hackathon to replace moment in a core library at my company. This is a big deal for the javascript community who actively downloads moment almost 15 million times a week. MomentJs recently announced that the library is now deprecated. If you have any questions feel free to post them in the comment section below or in SAP Community Q&A. We also recommend developers to switch to DayDateTimeAdapter if they are not using Moment.js in their existing application.įollow the Fundamental Library Styles Community to stay tuned for the updates. Although, we do not recommend picking MomentDateTimeAdapter for the new projects. ![]() Developers who use Moment.js in their existing applications can use MomentDateTimeAdapter since the migration to DayDateTimeAdapter can cause issues. output => "Friday, October 4th 2019, 7:12:49 PMįundamental Library NGX is providing the developers with both options. dayjs requires advancedFormat plugin to support more format tokensĭayjs().format('dddd, MMMM Do YYYY, h:mm:ss A') dayjs().format('dddd, MMMM D YYYY, h:mm:ss A') The code below, returns the formatted date string in the given format. import advancedFormat from 'dayjs/plugin/customParseFormat' import moment, from 'dayjs' Īdditionally, if you would like to used Advance format for the date and time, you will need to add the code snippet below. If you are already using Fundamental Library NGX you don’t need to install the library. ![]() We are going throught an example for a quick comparison between Moment.js and Day.js in Fundamental Library NGX.įirstly you need to import the moment library. Day.js is actually built in the way it mimics MomentJS’s APIs.In order to fix this bug, we incorporated Day.js library. ![]() The latest version update on the 22nd of March, 2022 reflects this bug. This was a common source of complaints about Moment and this bug was also reflected in the Fundamental Library NGX adapter. Considering that Moment.js objects are mutable. One of the Fundamental Library NGX adapters, MomentDateTimeAdapter was using the Moment.js library. The reasons for such a decision are explained on the Moment.js website.īut how does the deprecation of Moment.js affect Fundamental Library NGX? The Moment.js team has announced the end of the active development and they no longer update or add new features. Moment.js has officially been deprecated as of September 2020. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |