secullum-react-native-ui 4.5.1-beta.17 → 4.5.1-beta.18
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.
|
@@ -92,7 +92,7 @@ class DatePicker extends React.Component {
|
|
|
92
92
|
React.createElement(react_native_1.View, { nativeID: nativeID, style: [styles.container, style, disabled ? styles.readonly : null] },
|
|
93
93
|
React.createElement(react_native_1.View, null,
|
|
94
94
|
React.createElement(react_native_1.Text, { style: styles.label }, label),
|
|
95
|
-
React.createElement(react_native_1.Text, { style: styles.value }, value ? (0, format_1.formatDate)(value, '
|
|
95
|
+
React.createElement(react_native_1.Text, { style: styles.value }, value ? (0, format_1.formatDate)(value, 'cccc, dd/MM/yyyy') : '')),
|
|
96
96
|
!disabled && (React.createElement(ImageButton_1.ImageButton, { icon: value && clearable ? 'times' : 'calendar', style: styles.clearIcon, iconColor: value && clearable ? theme.textColor1 : theme.textColor2, onPress: value && clearable ? this.handleClear : this.handlePress, hitBoxSize: 30 })),
|
|
97
97
|
react_native_1.Platform.OS !== 'web' && (React.createElement(react_native_modal_datetime_picker_1.default, { date: value || undefined, isVisible: showModal, onConfirm: this.handleConfirm, onCancel: this.handleCancel, isDarkModeEnabled: isDarkModeEnabled,
|
|
98
98
|
//@ts-ignore
|
package/lib/modules/format.js
CHANGED
|
@@ -3,9 +3,9 @@ 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')
|
|
7
|
-
en: require('date-fns/locale/en-US')
|
|
8
|
-
es: require('date-fns/locale/es')
|
|
6
|
+
pt: require('date-fns/locale/pt-BR'),
|
|
7
|
+
en: require('date-fns/locale/en-US'),
|
|
8
|
+
es: require('date-fns/locale/es')
|
|
9
9
|
};
|
|
10
10
|
let currentLocale = 'pt';
|
|
11
11
|
const setLocale = (locale) => {
|
|
@@ -21,14 +21,19 @@ const parseDate = (date, format) => {
|
|
|
21
21
|
};
|
|
22
22
|
exports.parseDate = parseDate;
|
|
23
23
|
const getDateFnsLocale = () => {
|
|
24
|
+
let fnsLocate = dfnslocales.en;
|
|
24
25
|
switch (currentLocale) {
|
|
25
26
|
case 'pt':
|
|
26
|
-
|
|
27
|
+
fnsLocate = dfnslocales.pt;
|
|
28
|
+
break;
|
|
27
29
|
case 'es':
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
fnsLocate = dfnslocales.es;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
if (fnsLocate.default) {
|
|
34
|
+
return fnsLocate.default;
|
|
31
35
|
}
|
|
36
|
+
return fnsLocate;
|
|
32
37
|
};
|
|
33
38
|
exports.getDateFnsLocale = getDateFnsLocale;
|
|
34
39
|
const fixPortugueseLowercase = (formattedDate) => {
|