Skip to content

Commit

Permalink
[feat]: Date + Geo module updated to latest i18nify
Browse files Browse the repository at this point in the history
  • Loading branch information
tarun-khanna committed Jul 22, 2024
1 parent 3c447c8 commit 7bc5479
Show file tree
Hide file tree
Showing 15 changed files with 395 additions and 411 deletions.
43 changes: 16 additions & 27 deletions packages/i18nify-playground/src/constants/date/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const DATE_FORMAT_INTL_INPUTS = [
key: 'calendar',
label: 'Calendar',
type: 'select',
supportedUtilName: ['formatDate', 'formatDateTime', 'parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: [
'buddhist',
'chinese',
Expand Down Expand Up @@ -31,13 +31,7 @@ export const DATE_FORMAT_INTL_INPUTS = [
key: 'numberingSystem',
label: 'Numbering System',
type: 'select',
supportedUtilName: [
'formatDate',
'formatDateTime',
'formatTime',
'getRelativeTime',
'parseDateTime',
],
supportedUtilName: ['formatDateTime', 'getRelativeTime', 'parseDateTime'],
options: [
'adlm',
'ahom',
Expand Down Expand Up @@ -132,98 +126,93 @@ export const DATE_FORMAT_INTL_INPUTS = [
key: 'hourCycle',
label: 'Hour Cycle',
type: 'select',
supportedUtilName: ['formatDateTime', 'formatTime'],
supportedUtilName: ['formatDateTime'],
options: ['h12', 'h24'],
defaultValue: 'h12',
},
{
key: 'weekday',
label: 'Weekday',
type: 'select',
supportedUtilName: [
'formatDate',
'formatDateTime',
'formatTime',
'parseDateTime',
'getWeekdays',
],
supportedUtilName: ['formatDateTime', 'parseDateTime', 'getWeekdays'],
options: ['long', 'short', 'narrow'],
defaultValue: 'long',
},
{
key: 'year',
label: 'Year',
type: 'select',
supportedUtilName: ['formatDate', 'formatDateTime', 'formatTime', 'parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: ['numeric', '2-digit'],
},
{
key: 'month',
label: 'Month',
type: 'select',
supportedUtilName: ['formatDate', 'formatDateTime', 'formatTime', 'parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: ['numeric', '2-digit', 'long', 'short', 'narrow'],
},
{
key: 'day',
label: 'Day',
type: 'select',
supportedUtilName: ['formatDate', 'formatDateTime', 'formatTime', 'parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: ['numeric', '2-digit'],
},
{
key: 'dayPeriod',
label: 'Day Period',
type: 'select',
supportedUtilName: ['formatDate', 'formatDateTime', 'formatTime', 'parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: ['narrow', 'short', 'long'],
},
{
key: 'hour',
label: 'Hour',
type: 'select',
supportedUtilName: ['formatDate', 'formatDateTime', 'formatTime', 'parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: ['numeric', '2-digit'],
},
{
key: 'minute',
label: 'Minute',
type: 'select',
supportedUtilName: ['formatDate', 'formatDateTime', 'formatTime', 'parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: ['numeric', '2-digit'],
},
{
key: 'second',
label: 'Second',
type: 'select',
supportedUtilName: ['formatDate', 'formatDateTime', 'formatTime', 'parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: ['numeric', '2-digit'],
},
{
key: 'fractionalSecondDigits',
label: 'Fractional Second Digits',
type: 'select',
supportedUtilName: ['formatDateTime', 'formatTime', 'parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: [1, 2, 3],
},
{
key: 'timeZoneName',
label: 'Timezone Name',
type: 'select',
supportedUtilName: ['formatDate', 'formatDateTime', 'formatTime', 'parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: ['long', 'short'],
},
{
key: 'dateStyle',
label: 'Date Style',
type: 'select',
supportedUtilName: ['parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: ['full', 'long', 'medium', 'short'],
},
{
key: 'timeStyle',
label: 'Time Style',
type: 'select',
supportedUtilName: ['parseDateTime'],
supportedUtilName: ['formatDateTime', 'parseDateTime'],
options: ['full', 'long', 'medium', 'short'],
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ const navConfig = [
path: '/date',
icon: icon('ic_date'),
children: [
{ title: 'FormatDate', path: '/date/formatDate' },
{ title: 'FormatDateTime', path: '/date/formatDateTime' },
{ title: 'FormatTime', path: '/date/formatTime' },
{ title: 'GetRelativeTime', path: '/date/getRelativeTime' },
{ title: 'GetWeekdays', path: '/date/getWeekdays' },
{ title: 'ParseDateTime', path: '/date/parseDateTime' },
Expand All @@ -65,11 +63,15 @@ const navConfig = [
path: '/geo',
icon: icon('ic_geo'),
children: [
{ title: 'GetFlagByCountry', path: '/geo/getFlagByCountry' },
{ title: 'GetListOfAllFlags', path: '/geo/getListOfAllFlags' },
{ title: 'GetFlagOfCountry', path: '/geo/getFlagOfCountry' },
{
title: 'GetFlagsForAllCountries',
path: '/geo/getFlagsForAllCountries',
},
{ title: 'GetAllCountries', path: '/geo/getAllCountries' },
{ title: 'GetStatesByCountry', path: '/geo/getStatesByCountry' },
{ title: 'GetStates', path: '/geo/getStates' },
{ title: 'GetCities', path: '/geo/getCities' },
{ title: 'GetZipcodes', path: '/geo/getZipcodes' },
],
},
{
Expand Down
99 changes: 0 additions & 99 deletions packages/i18nify-playground/src/pages/date/formatDate.jsx

This file was deleted.

99 changes: 0 additions & 99 deletions packages/i18nify-playground/src/pages/date/formatTime.jsx

This file was deleted.

Loading

0 comments on commit 7bc5479

Please sign in to comment.