-
-
Notifications
You must be signed in to change notification settings - Fork 12
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: Implement useDateField
with Temporals API
#115
Conversation
|
e44886d
to
c7e114d
Compare
useDateField
useDateField
useDateField
and useCalendar
ef1db9b
to
4024641
Compare
This reverts commit c7e114d.
d189c1a
to
f01a5ad
Compare
useDateField
and useCalendar
useDateField
and useCalendar
with Temporals API
useDateField
and useCalendar
with Temporals APIuseDateField
with Temporals API
Closing this in favor of #132 We will switch the implementation to use
I think once temporals hit baseline, we will make that switch, its such a shame because it is a great API imo. Another alternative, is we find or fork or build a minimal version of the temporal spec and use it internally. |
This pull request introduces several significant changes to the i18n (internationalization) and calendar functionalities within the
packages/core
module. The most important changes include the addition of new dependencies, enhancements to locale handling, and the introduction of new calendar-related utilities.Enhancements to locale handling:
packages/core/src/i18n/getCalendar.ts
: Added a new functiongetCalendar
to retrieve the calendar identifier for a given locale.packages/core/src/i18n/getDirection.ts
: Modified thegetDirection
function to accept anIntl.Locale
object instead of a string.packages/core/src/i18n/getTimezone.ts
: Added a new functiongetTimeZone
to retrieve the timezone for a given locale.packages/core/src/i18n/getWeekInfo.ts
: Added a new functiongetWeekInfo
to retrieve week information for a given locale.packages/core/src/i18n/useLocale.ts
: Enhanced theuseLocale
composable to support locale extensions and retrieve additional locale-related information.Calendar-related utilities:
packages/core/src/useCalendar/index.ts
: Introduced new exports for calendar-related functionalities.packages/core/src/useCalendar/types.ts
: Defined new types for calendar identifiers and calendar days.packages/core/src/useCalendar/useCalendar.ts
: Implemented theuseCalendar
composable to manage calendar state and provide calendar-related data.packages/core/src/useCalendar/useCalendarCell.ts
: Added theuseCalendarCell
composable andCalendarCell
component for managing individual calendar cells.New dependencies:
packages/core/package.json
: Added the@js-temporal/polyfill
dependency to support temporal functionalities.Additional changes:
packages/core/src/constants/index.ts
: Added new field type prefixes forDateTimeField
andDateTimeSegment
.packages/core/src/useDateTimeField/constants.ts
: Introduced utility functions for handling date-time segments.packages/core/src/useDateTimeField/index.ts
: Added exports for date-time field functionalities.packages/core/src/i18n/useDateFormatter/index.ts
: Implemented theuseDateFormatter
composable to format dates using the temporal polyfill.packages/core/src/i18n/useNumberParser/index.ts
: Enhanced theuseNumberParser
composable with additional functionality and type definitions. [1] [2] [3] [4] [5]