-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌟 Day.js 2.0 alpha preview is available #1879
Comments
Would you be open to a PR to convert the library to ESM for 2.0? |
@benmccann 2.0 supports ESM now, you can try it |
Thanks! Sorry for the noise. I didn't realize that as there wasn't any update on #1765 |
I bumped to the v2 alpha (build 2) and it looks like some plugins are missing from the packaged bundles. Things I was looking for are |
As mentioned in issue content.
|
文档在哪里呢? |
旧文档也适用 |
Perhaps it is a good idea to stay with English in this repository so that everybody can follow the discussions (but perhaps it is a good idea to use it to improve our knowledge of foreign languages - just kidding ;-) |
IMHO it is a good idea to redo the code base for dayjs because this way we have a chance to improve the usability for typescript and add esm support.
As a next step, I will add more examples to my test project (e.g. using locales). If you need a helping hand, I could contribute e.g. one of the plugins. As I am currently working on issue #1596, perhaps I could "migrate" the Anyway, thanks for starting this "issue" 👍 |
If reworking the code, a rethink on how plugins are included would be nice (especially since only two or three have been implemented). Currently my static analysis tools aren't able to determine when a particular plug-in is no longer used because each is immediately referenced by name within my codebase, e.g.: import dayjs, { type Dayjs } from 'dayjs';
import weekOfYear from 'dayjs/plugin/weekOfYear.js';
import isBetween from 'dayjs/plugin/isBetween.js';
dayjs.extend(weekOfYear);
dayjs.extend(isBetween); If I stop using I realize the way the plug-ins are architected this goal is not easily achievable but perhaps someone knows a technique which might help address this. |
Fixed, f3088ea
It's a good practice, i think. The You can see the bundle files here. https://unpkg.com/browse/[email protected]/
dayjs 2 uses pnpm now. Please remove
OK, I will add it later.
That's great. But I don't have a lot of time to focus on open source at the moment, so your PR may not be reviewed in time, but I'll do it as soon as I can. ❤️ |
@vhscom |
But anyway that is what I call a real fast answer 👍 So I will create a pr for issue #1596 for dayjs v2.0 - will take a few days. |
hey guys, thank you for your work, is any estimates when v2 will be finished and ready for use in production? |
Still struggling with the baseline: when building the project with
although the compilerOptions in Any idea why this happens or am I the only one with effect? |
@BePo65 Fixed. |
After a very simple plugin, I am now working on a more complex plugin - the Currently I have 2 problems:
Any help appreciated 😄 |
I'd love if #498 could be implemented on the |
I am currently working on the utc and customParseFormat plugins as examples for more complex plugins. During that investigation I noticed that the But then I stumbled over the fact that in the definition of Are the letters 'd' and 'D' just swapped in the definition of Units or do I simply not understand the unit definitions (they are quite complex and understanding the use of the different types requires some time :-). So @iamkun can you help me understand the add / subtract signature or the definition of the units? |
@BePo65, as |
Run console.log(dayjs().format(`YYYY-MM-DD`)) // 2022-09-23
console.log(dayjs().subtract(1, 'day').format(`YYYY-MM-DD`)) // 2022-09-22 The outputs are as expected. Run console.log(dayjs().format(`YYYY-MM-DD`))) // 2022-09-23
console.log(dayjs().subtract(1, 'day').format(`YYYY-MM-DD`))) // 2022-09-23 Expression above got the same output which is weired. Instead with |
I don't know where the duration plugin is... |
The plugin is not yet implemented. Feel free to create a pr for that 😃 |
Urgent question about the base branch for dayjs2.0 @sxzz I am currently working on implementing the more complicated plugins for dayjs 2.0 ('utc', 'CustomParseFormat'); my base for this code is the branch 'next'. Now I noticed that the name of branches changed; there is even a new branch '2.0' (using jest and not vitest). |
@BePo65 Currently, we plan to release |
any news when v2 will be available? |
dayjs 2 will be experimental in Element Plus v3 branch. When it gets stable, then we will consider making dayjs 2 into the stable branch. |
any changes> when will be new release? |
Last change in v2 has been made 8 month ago. I think no one is working on v2. |
Bump |
Any news? |
R u alive? |
I hope this will continue ... |
Is there somebody out there, who is willing to take over this project? I will gladly do my part to help improve dayjs, but only if there is a chance that prs will be reviewed and merged / rejected in a timely manner. What do you think? |
@sxzz does it make sense to wait for version 2? |
any news on this? :( |
Sadly, I switched to date-fns (it uses native Date as input which is kinda nice), since Dayjs was the last CommonJS lib and I really wanted to be full ESM. Would love to go back since I love the API on dayjs (and it wasn't that difficult to migrate). |
bump |
The v2 branch is here #2066
If you have issues with v2, please comment on this issue. Please do not comment on irrelevant content.
Changelog
Outdated
The information is outdated, we're planning them released when v3.0.
Changelog
2.0.0-alpha.0
Breaking Change
dayjs.locale(preset, object, isLocal)
=>dayjs.locale(preset, isLocal, object)
>import 'dayjs/plugin/isToday'
import 'dayjs/dist/plugin/isToday'
Feature
The text was updated successfully, but these errors were encountered: