secullum-react-native-ui 4.5.1-beta.20 → 4.5.1-beta.22
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/lib/modules/format.d.ts +1 -1
- package/lib/modules/format.js +2 -2
- package/package.json +1 -1
package/lib/modules/format.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export declare const setLocale: (locale: Locale) => void;
|
|
|
3
3
|
export declare const getLocale: () => Locale;
|
|
4
4
|
export declare const parseDate: (date: string, format: string) => Date;
|
|
5
5
|
export declare const getDateFnsLocale: () => any;
|
|
6
|
-
export declare const formatDate: (date: Date, format: string) => string;
|
|
6
|
+
export declare const formatDate: (date: Date | string, format: string) => string;
|
package/lib/modules/format.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.formatDate = exports.getDateFnsLocale = exports.parseDate = exports.getLocale = exports.setLocale = void 0;
|
|
4
4
|
const date_fns_1 = require("date-fns");
|
|
5
5
|
const dfnslocales = {
|
|
6
|
-
pt: require('date-fns/locale/pt'),
|
|
6
|
+
pt: require('date-fns/locale/pt-BR'),
|
|
7
7
|
en: require('date-fns/locale/en-US'),
|
|
8
8
|
es: require('date-fns/locale/es')
|
|
9
9
|
};
|
|
@@ -95,7 +95,7 @@ const fixSpanishLowercase = (formattedDate) => {
|
|
|
95
95
|
return formattedDate;
|
|
96
96
|
};
|
|
97
97
|
const formatDate = (date, format) => {
|
|
98
|
-
const formattedDate = (0, date_fns_1.format)(date, format, {
|
|
98
|
+
const formattedDate = (0, date_fns_1.format)(typeof date === 'string' ? new Date(date) : date, format, {
|
|
99
99
|
locale: (0, exports.getDateFnsLocale)()
|
|
100
100
|
});
|
|
101
101
|
switch (currentLocale) {
|