@fto-consult/expo-ui 2.12.1 → 2.12.3
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/package.json
CHANGED
|
@@ -46,9 +46,9 @@ export default function DateTimePickerComponent({left,isPeriodAction,contentProp
|
|
|
46
46
|
date : dateObj,
|
|
47
47
|
}}
|
|
48
48
|
const getTimeValue = (date)=>{
|
|
49
|
-
date = DateLib.isValid(date)? date :
|
|
50
|
-
const sqlTime = date.toSQLTimeFormat();
|
|
51
|
-
return sqlTime
|
|
49
|
+
date = DateLib.isValid(date)? date : null;
|
|
50
|
+
const sqlTime = date && date.toSQLTimeFormat() || '';
|
|
51
|
+
return sqlTime?.substring(0,withSeconds ?sqlTime?.length :5);
|
|
52
52
|
}
|
|
53
53
|
const timeDefaultValue = getTimeValue(dateObj);
|
|
54
54
|
const changedTimeArgsRef = {current:{...defaultObj(parseTime(timeDefaultValue,withSeconds))}};
|
|
@@ -143,6 +143,7 @@ export default function TimePickerComponent (props){
|
|
|
143
143
|
onTimeChange = {(date)=>{
|
|
144
144
|
return onConfirm({hours:date?.getHours(),minutes:date?.getMinutes()})
|
|
145
145
|
}}
|
|
146
|
+
theme = {theme}
|
|
146
147
|
onDismiss = {closeModal}
|
|
147
148
|
locale={defaultStr(rest.locale,dialogProps.locale,locale)}
|
|
148
149
|
uppercase = {(upper === true || upperCase === true) ? true : false}
|
|
@@ -11,6 +11,10 @@ export const locale = "fr";
|
|
|
11
11
|
export const toDateObj = (value,format,force)=>{
|
|
12
12
|
if(!value) return undefined;
|
|
13
13
|
if(DateLib.isDateObj(value)) return value;
|
|
14
|
+
try {
|
|
15
|
+
const d = new Date(value);
|
|
16
|
+
if(DateLib.isValid(d)) return d;
|
|
17
|
+
} catch{}
|
|
14
18
|
if(format !== false){
|
|
15
19
|
value = DateLib.toObj(value,format);
|
|
16
20
|
}
|