mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
fix: simplify time input
This commit is contained in:
@@ -34,12 +34,12 @@ export default function EditableTimer(props) {
|
||||
if (value === '') return false;
|
||||
|
||||
// Time now and time submitedVal
|
||||
const original = stringFromMillis(time, false);
|
||||
const original = stringFromMillis(time + delay, false);
|
||||
|
||||
// check if time is different from before
|
||||
if (value === original) return false;
|
||||
|
||||
// conver to millis object
|
||||
// convert to millis object
|
||||
const millis = timeStringToMillis(value, timeFormat);
|
||||
|
||||
// validate with parent
|
||||
@@ -51,14 +51,8 @@ export default function EditableTimer(props) {
|
||||
return true;
|
||||
};
|
||||
|
||||
const showOriginal = () => {
|
||||
setValue(stringFromMillis(time, false));
|
||||
};
|
||||
|
||||
return (
|
||||
<Editable
|
||||
onFocus={() => showOriginal}
|
||||
onEdit={() => showOriginal}
|
||||
onChange={(v) => setValue(v)}
|
||||
onSubmit={(v) => validateValue(v)}
|
||||
value={value}
|
||||
|
||||
Reference in New Issue
Block a user