secullum-react-native-ui 4.5.1-beta.2 → 4.5.1-beta.21
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
|
|
@@ -103,7 +103,7 @@ class RangeDatePicker extends React.Component {
|
|
|
103
103
|
render() {
|
|
104
104
|
const { label, startDate, endDate, style, nativeID } = this.props;
|
|
105
105
|
const { showStartDateModal, showEndDateModal, isDarkModeEnabled } = this.state;
|
|
106
|
-
const displayFormat = 'MMM
|
|
106
|
+
const displayFormat = 'MMM d, yyyy';
|
|
107
107
|
const displayText = (0, format_1.formatDate)(startDate, displayFormat) +
|
|
108
108
|
' - ' +
|
|
109
109
|
(0, format_1.formatDate)(endDate, displayFormat);
|
|
@@ -88,7 +88,7 @@ class RangeDatePicker extends React.Component {
|
|
|
88
88
|
render() {
|
|
89
89
|
const { label, startDate, endDate, style, nativeID } = this.props;
|
|
90
90
|
const { showStartDateModal } = this.state;
|
|
91
|
-
const displayFormat = 'MMM
|
|
91
|
+
const displayFormat = 'MMM d, yyyy';
|
|
92
92
|
const displayText = (0, format_1.formatDate)(startDate, displayFormat) +
|
|
93
93
|
' - ' +
|
|
94
94
|
(0, format_1.formatDate)(endDate, displayFormat);
|
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
|
@@ -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) => {
|
|
@@ -90,7 +95,7 @@ const fixSpanishLowercase = (formattedDate) => {
|
|
|
90
95
|
return formattedDate;
|
|
91
96
|
};
|
|
92
97
|
const formatDate = (date, format) => {
|
|
93
|
-
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, {
|
|
94
99
|
locale: (0, exports.getDateFnsLocale)()
|
|
95
100
|
});
|
|
96
101
|
switch (currentLocale) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "secullum-react-native-ui",
|
|
3
|
-
"version": "4.5.1-beta.
|
|
3
|
+
"version": "4.5.1-beta.21",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@react-native-community/datetimepicker": "^3.0.9",
|
|
23
|
-
"date-fns": "2.
|
|
24
|
-
"react-date-range": "^1.
|
|
23
|
+
"date-fns": "^2.29.3",
|
|
24
|
+
"react-date-range": "^1.4.0",
|
|
25
25
|
"react-native-drawer-layout": "^2.0.0",
|
|
26
26
|
"react-native-elevated-view": "^0.0.6",
|
|
27
27
|
"react-native-masked-text": "^1.7.2",
|
|
28
|
-
"react-native-modal-datetime-picker": "^
|
|
28
|
+
"react-native-modal-datetime-picker": "^14.0.1",
|
|
29
29
|
"react-native-status-bar-height": "^2.6.0",
|
|
30
30
|
"react-native-vector-icons": "^8.0.0",
|
|
31
31
|
"react-native-web-modal": "^1.0.1"
|