Skip to content

Commit

Permalink
mini refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
JoCa96 committed Nov 28, 2024
1 parent 7bd6616 commit d2e9e32
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,12 @@ const getNormalizedDate = computed(() => {
// for datetime type, the hour must be in the users local timezone so just returning the string returned by `toISOString()` will be invalid
// since the timezone offset is missing then
return `${dateString}T${padStart(date.getHours())}:${padStart(date.getMinutes())}`;
const hours = date.getHours().toString().padStart(2, "0");
const minutes = date.getMinutes().toString().padStart(2, "0");
return `${dateString}T${hours}:${minutes}`;
};
});
/**
* Pad starts the given number with leading zeros if needed to make it 2 digits long.
*/
const padStart = (value: number) => value.toString().padStart(2, "0");
/**
* Current value (with getter and setter) that can be used as "v-model" for the native input.
*/
Expand Down

0 comments on commit d2e9e32

Please sign in to comment.