react-country-kit-core 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data/dateFormats.d.ts +3 -0
- package/dist/hooks/useDateFormat.d.ts +16 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1819 -255
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.ts +7 -0
- package/dist/utils/date.d.ts +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IDateFormat } from '../types';
|
|
2
|
+
export interface IUseDateFormatReturn {
|
|
3
|
+
dateFormat: IDateFormat | null;
|
|
4
|
+
formatDate: (date: Date) => string;
|
|
5
|
+
parseDate: (dateString: string) => Date | null;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
weekStart: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A hook that provides country-specific date formatting details, placeholders, first day of the week,
|
|
11
|
+
* and format/parse utilities.
|
|
12
|
+
*
|
|
13
|
+
* @param countryIso2 ISO2 country code (case-insensitive)
|
|
14
|
+
* @returns Date formatting information and helper functions
|
|
15
|
+
*/
|
|
16
|
+
export declare function useDateFormat(countryIso2?: string | null): IUseDateFormatReturn;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './data/languages';
|
|
|
4
4
|
export * from './data/timezones';
|
|
5
5
|
export * from './data/phoneFormats';
|
|
6
6
|
export * from './data/currencies';
|
|
7
|
+
export { default as DATE_FORMATS } from './data/dateFormats';
|
|
7
8
|
export * from './hooks/useCountryPicker';
|
|
8
9
|
export * from './hooks/useCountry';
|
|
9
10
|
export * from './hooks/useCurrencyPicker';
|
|
@@ -13,9 +14,11 @@ export * from './hooks/useTimezonePicker';
|
|
|
13
14
|
export * from './hooks/usePhoneInput';
|
|
14
15
|
export * from './hooks/useMultiSelect';
|
|
15
16
|
export * from './hooks/useBasePicker';
|
|
17
|
+
export * from './hooks/useDateFormat';
|
|
16
18
|
export * from './utils/countries';
|
|
17
19
|
export * from './utils/currencies';
|
|
18
20
|
export * from './utils/languages';
|
|
19
21
|
export * from './utils/timezones';
|
|
20
22
|
export * from './utils/phone';
|
|
23
|
+
export * from './utils/date';
|
|
21
24
|
export * from './types';
|