Moment.js to Temporal API #5822
Replies: 1 comment 1 reply
|
Thanks for bringing this up. I agree that moving away from Moment.js is a good long-term direction, and Temporal is likely the right eventual target. A small compatibility clarification: native Temporal is enabled by default starting with Node.js 26, not Node.js 22. Node.js 26 is currently a Current release and will enter LTS in October 2026. Hexo currently supports Node.js There is also more migration work involved than replacing a few function calls. Moment is currently part of several Hexo interfaces:
Therefore, replacing Moment would probably need to be a staged, major-version change. As an intermediate step, [hexo-front-matter#146](hexojs/hexo-front-matter#146) uses Luxon internally to interpret a timezone-less YAML timestamp in the timezone configured by Hexo. It still returns a native |
Uh oh!
There was an error while loading. Please reload this page.
Hey all!
I rummaged around to see if this had already been up for debate but I couldn't find anything. So, if that's the case, I apologies.
Since Hexo uses Moment.js for date and time handling, I was wondering if there is a plan in place to move away from it towards Temporal API in future releases? I think that would be a massive benefit and would shave off some of the bloat.
Node.js support is complete and stable. Version 22 LTS has Temporal enabled by default and in all modern browsers since 3 years Temporal is native.
Just an idea to modernize this framework a bit :)
Hope you're all having a great day!
All reactions