diff --git a/packages/i18nify-playground/src/constants/date/index.js b/packages/i18nify-playground/src/constants/date/index.js
index 3dc40d5f..099c0fa3 100644
--- a/packages/i18nify-playground/src/constants/date/index.js
+++ b/packages/i18nify-playground/src/constants/date/index.js
@@ -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',
@@ -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',
@@ -132,7 +126,7 @@ export const DATE_FORMAT_INTL_INPUTS = [
key: 'hourCycle',
label: 'Hour Cycle',
type: 'select',
- supportedUtilName: ['formatDateTime', 'formatTime'],
+ supportedUtilName: ['formatDateTime'],
options: ['h12', 'h24'],
defaultValue: 'h12',
},
@@ -140,90 +134,85 @@ export const DATE_FORMAT_INTL_INPUTS = [
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'],
},
];
diff --git a/packages/i18nify-playground/src/layouts/dashboard/config-navigation.jsx b/packages/i18nify-playground/src/layouts/dashboard/config-navigation.jsx
index f866639f..8bccc0e7 100644
--- a/packages/i18nify-playground/src/layouts/dashboard/config-navigation.jsx
+++ b/packages/i18nify-playground/src/layouts/dashboard/config-navigation.jsx
@@ -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' },
@@ -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' },
],
},
{
diff --git a/packages/i18nify-playground/src/pages/date/formatDate.jsx b/packages/i18nify-playground/src/pages/date/formatDate.jsx
deleted file mode 100644
index 795adecb..00000000
--- a/packages/i18nify-playground/src/pages/date/formatDate.jsx
+++ /dev/null
@@ -1,99 +0,0 @@
-import { useState } from 'react';
-import { formatDateTime } from '@razorpay/i18nify-js';
-
-import dayjs from 'dayjs';
-import Container from '@mui/material/Container';
-import { Grid, useTheme, Typography, useMediaQuery } from '@mui/material';
-
-import { removeEmptyValues } from 'src/utils';
-import { useIntlOptionsDateContext } from 'src/context/intlOptionsDateContext';
-
-import DateForm from 'src/sections/date/date-form';
-import { useI18nContext } from '@razorpay/i18nify-react';
-
-// ----------------------------------------------------------------------
-
-export default function FormatDate() {
- const [inpValue, setInpValue] = useState(new Date());
- const { intlDateOptions } = useIntlOptionsDateContext();
- const theme = useTheme();
- const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
- const { i18nState } = useI18nContext();
- const { locale } = i18nState;
-
- return (
-
-
-
-
- FormatDate
-
-
-
- ππ This global time stylist effortlessly turns your dates into
- beautifully formatted strings, tailored to different locales.
- Whether you're dealing with international clients or just love the
- beauty of diverse date formats, `formatDate` is your go-to function.
- It leverages the power of the Intl.DateTimeFormat API, ensuring that
- your dates always dress to impress, no matter where they're
- displayed. π©π
-
-
- {isMobile && (
-
-
-
-
- {formatDateTime(new Date(inpValue), {
- locale,
- intlOptions: removeEmptyValues(intlDateOptions),
- })}
-
-
-
-
- )}
-
- {
- setInpValue(dayjs(val));
- }}
- includeIntlOptions={true}
- />
-
- {!isMobile && (
-
-
-
-
- {formatDateTime(new Date(inpValue), {
- locale,
- intlOptions: removeEmptyValues(intlDateOptions),
- })}
-
-
-
-
- )}
-
-
- );
-}
diff --git a/packages/i18nify-playground/src/pages/date/formatTime.jsx b/packages/i18nify-playground/src/pages/date/formatTime.jsx
deleted file mode 100644
index 0bfd52f8..00000000
--- a/packages/i18nify-playground/src/pages/date/formatTime.jsx
+++ /dev/null
@@ -1,99 +0,0 @@
-import { useState } from 'react';
-import { formatDateTime } from '@razorpay/i18nify-js';
-
-import dayjs from 'dayjs';
-import Container from '@mui/material/Container';
-import { Grid, useTheme, Typography, useMediaQuery } from '@mui/material';
-
-import { removeEmptyValues } from 'src/utils';
-import { useIntlOptionsDateContext } from 'src/context/intlOptionsDateContext';
-
-import DateForm from 'src/sections/date/date-form';
-import { useI18nContext } from '@razorpay/i18nify-react';
-
-// ----------------------------------------------------------------------
-
-export default function FormatTime() {
- const [inpValue, setInpValue] = useState(new Date());
- const { intlDateOptions } = useIntlOptionsDateContext();
- const theme = useTheme();
- const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
- const { i18nState } = useI18nContext();
- const { locale } = i18nState;
-
- return (
-
-
-
-
- FormatTime
-
-
-
- β°π This timely charmer is your key to unlocking the secrets of
- time presentation across different cultures. Using the wizardry of
- the Internationalization API (Intl), formatTime translates your time
- into a format that resonates with local customs and practices.
- Whether itβs for scheduling international calls or just making sure
- youβre in sync with the worldβs timezones, this function is your
- trusty sidekick in the realm of time formatting! πβ
-
-
- {isMobile && (
-
-
-
-
- {formatDateTime(new Date(inpValue), {
- locale,
- intlOptions: removeEmptyValues(intlDateOptions),
- })}
-
-
-
-
- )}
-
- {
- setInpValue(dayjs(val));
- }}
- includeIntlOptions={true}
- />
-
- {!isMobile && (
-
-
-
-
- {formatDateTime(new Date(inpValue), {
- locale,
- intlOptions: removeEmptyValues(intlDateOptions),
- })}
-
-
-
-
- )}
-
-
- );
-}
diff --git a/packages/i18nify-playground/src/pages/date/getRelativeTime.jsx b/packages/i18nify-playground/src/pages/date/getRelativeTime.jsx
index 15b690d6..6658a878 100644
--- a/packages/i18nify-playground/src/pages/date/getRelativeTime.jsx
+++ b/packages/i18nify-playground/src/pages/date/getRelativeTime.jsx
@@ -30,17 +30,23 @@ export default function GetRelativeTime() {
- β³π This time-traveling virtuoso effortlessly bridges the gap between dates, offering a
- glimpse into the past or a peek into the future. With the help of the
- Internationalization API (Intl), getRelativeTime transforms absolute dates into
- relatable, human-friendly phrases like β3 hours agoβ or βin 2 daysβ. Whether youβre
- reminiscing the past or anticipating the future, this function keeps you connected to
- time in the most intuitive way! ππ°οΈ
+ β³π This time-traveling virtuoso effortlessly bridges the gap
+ between dates, offering a glimpse into the past or a peek into the
+ future. With the help of the Internationalization API (Intl),
+ getRelativeTime transforms absolute dates into relatable,
+ human-friendly phrases like β3 hours agoβ or βin 2 daysβ. Whether
+ youβre reminiscing the past or anticipating the future, this
+ function keeps you connected to time in the most intuitive way! ππ°οΈ
{isMobile && (
-
+
{getRelativeTime(new Date(inpValue), new Date(), {
@@ -55,7 +61,9 @@ export default function GetRelativeTime() {
{!isMobile && (
-
+
{getRelativeTime(new Date(inpValue), new Date(), {
diff --git a/packages/i18nify-playground/src/pages/date/getWeekdays.jsx b/packages/i18nify-playground/src/pages/date/getWeekdays.jsx
index ac4ca002..f22ad824 100644
--- a/packages/i18nify-playground/src/pages/date/getWeekdays.jsx
+++ b/packages/i18nify-playground/src/pages/date/getWeekdays.jsx
@@ -20,9 +20,12 @@ export default function GetWeekdays() {
const { locale } = i18nState;
const code = JSON.stringify(
- getWeekdays({ locale, intlOptions: { weekday: removeEmptyValues(intlDateOptions).weekday } }),
+ getWeekdays({
+ locale,
+ weekday: removeEmptyValues(intlDateOptions).weekday,
+ }),
null,
- 2
+ 2,
);
return (
@@ -34,18 +37,28 @@ export default function GetWeekdays() {
- π
π This global day-namer is your trusty guide through the week, no matter where you
- are in the world. Using the power of the Internationalization API (Intl), getWeekdays
- serves up the names of all seven days tailored to your chosen locale. From planning
- international meetings to creating a multilingual planner, this function provides the
- perfect blend of cultural awareness and practical utility, keeping you in sync with the
- local rhythm of life, one day at a time! πποΈ
+ π
π This global day-namer is your trusty guide through the week, no
+ matter where you are in the world. Using the power of the
+ Internationalization API (Intl), getWeekdays serves up the names of
+ all seven days tailored to your chosen locale. From planning
+ international meetings to creating a multilingual planner, this
+ function provides the perfect blend of cultural awareness and
+ practical utility, keeping you in sync with the local rhythm of
+ life, one day at a time! πποΈ
{isMobile && (
-
-
+
+
@@ -54,14 +67,24 @@ export default function GetWeekdays() {
{!isMobile && (
-
-
+
+
diff --git a/packages/i18nify-playground/src/pages/geo/getAllCountries.jsx b/packages/i18nify-playground/src/pages/geo/getAllCountries.jsx
index 09df5b47..655f391c 100644
--- a/packages/i18nify-playground/src/pages/geo/getAllCountries.jsx
+++ b/packages/i18nify-playground/src/pages/geo/getAllCountries.jsx
@@ -31,17 +31,26 @@ export default function GetAllCountries() {
- π Ready to dive into the world of nations? Say hello to getAllCountries! This dynamic
- function is your gateway to a comprehensive list of countries spanning the globe. With
- just a simple call, you'll unlock a treasure trove of international data, perfect for
- any coding adventurer. πΊοΈπ
+ π Ready to dive into the world of nations? Say hello to
+ getAllCountries! This dynamic function is your gateway to a
+ comprehensive list of countries spanning the globe. With just a
+ simple call, you'll unlock a treasure trove of international data,
+ perfect for any coding adventurer. πΊοΈπ
{isMobile && (
-
-
+
+
@@ -50,7 +59,9 @@ export default function GetAllCountries() {
{!isMobile && (
-
-
+
+
diff --git a/packages/i18nify-playground/src/pages/geo/getCities.jsx b/packages/i18nify-playground/src/pages/geo/getCities.jsx
index 0403cf94..b26b2564 100644
--- a/packages/i18nify-playground/src/pages/geo/getCities.jsx
+++ b/packages/i18nify-playground/src/pages/geo/getCities.jsx
@@ -52,7 +52,7 @@ export default function GetCities() {
if (!stateInp) return;
getCities(countryInp, stateInp).then((res) => {
setCities(res);
- setCityInp(res[0]);
+ setCityInp(res[0].name);
setCode(JSON.stringify(res, null, 2));
});
}, [stateInp]);
@@ -121,7 +121,7 @@ export default function GetCities() {
}}
>
{cities.map((city) => (
-