-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
feat(DatePicker): update date library package #761
Conversation
❤️ a Question, How to use another Calendar System without setting before:const persian = createCalendarDate({
calendar: CALENDAR.PERSIAN,
year: 1403,
month: 12,
day: 1,
}) after:const persian = createCalendarDate({
calendar: CALENDAR.PERSIAN,
}) Automatically use |
@sadeghbarati You could try this approach for getting today's date in a different calendar system.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phenomenal work @epr3 ! Will have a look asap! 💚
…unt for calendar changes
@epr3 Thanks! That will help |
I think the problem lies in this function. You need to radix-vue/packages/radix-vue/src/shared/date/comparators.ts Lines 33 to 58 in c2e5c1c
|
@MellKam I pulled in your repo and set it up, looks like Histoire still outputs errors: Screen.Recording.2024-03-26.at.11.15.19.movBut on Stackblitz, it is working properly. 👍🏻 |
It's strange because it doesn't work for me on the histoire page either, but it works when I open it in a separate window. Maybe it is some problem with the histoire cache |
Different browser, incognito window: Screen.Recording.2024-03-26.at.11.41.20.movRemoved Screen.Recording.2024-03-26.at.11.45.16.movAm I doing something wrong? |
Wait, now it's a different error. Let me check it |
One culprit that I could identify (other than Vue's reactivity system) which might cause the |
@epr3 That's definitely it! Here is updated version of my previous playground but I changed |
@MellKam I think I finally figured out the what might be the issue. I've pulled in your playground code into a Histoire story for debugging and I found out that while everything might work fine in a normal application (or playground in this instance), Histoire might do some shenanigans (like Video for reference: Screen.Recording.2024-03-27.at.11.40.40.movIn short, the issue won't happen in a normal I'll revert the date library back to I'll also dig through Histoire and see how it passes data between its Sorry for the delays in getting these fixes merged. cc @sadeghbarati Unfortunately, until Adobe merges this PR, the |
@epr3, that's OK ❤️ I'll patch it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick question, and I'm thoroughly amazed by all the discussion, research and back-and-forth testing to nail down the issue here!
Really apprecate @epr3 @sadeghbarati @MellKam !!! 💚💯
Closes #742.
Hello,
I forked and refactored Adobe's
@internationalized/date
package and converted all ES6 classes into plain objects and converted the original class methods into functions. All functions return new calendar objects and are immutable.Then, I've refactored the whole implementation of the
Calendar
,DateField
andDatePicker
components to use this library and removed some redundant functions, updated the docs and added localised stories for some of the calendars in Histoire.It should fix all errors that were caused by Vue changing the
this
context from theDateValue
class to it's ownProxy
class (plus any date jumps to the Gregorian Calendar and back causing dates to desync).This is the library: https://www.npmjs.com/package/flat-internationalized-date
If you guys want, I can relinquish the package ownership to the
radix-vue
org in Github and continue maintenance underradix-vue
.I'm looking forward to any feedback and improvements you suggest.
Thanks!
CC-ing @sadeghbarati for the Persian Calendar fixes.