Merge pull request #44 from devSwoop/main
Ajout de l'heure actuelle en valeur par défaut de l'heure de sortie
This commit is contained in:
commit
a2566e8255
1 changed files with 9 additions and 0 deletions
|
@ -13,6 +13,11 @@ const createTitle = () => {
|
|||
}
|
||||
// createElement('div', { className: 'form-group' })
|
||||
|
||||
const getCurrentTime = () => {
|
||||
const date = new Date();
|
||||
return date.toLocaleTimeString('fr-FR', { hour: '2-digit', minute: '2-digit' });
|
||||
}
|
||||
|
||||
const createFormGroup = ({
|
||||
autocomplete = false,
|
||||
autofocus = false,
|
||||
|
@ -55,6 +60,10 @@ const createFormGroup = ({
|
|||
|
||||
const input = createElement('input', inputAttrs)
|
||||
|
||||
if (name === 'heuresortie') {
|
||||
input.value = getCurrentTime()
|
||||
}
|
||||
|
||||
const validityAttrs = {
|
||||
className: 'validity',
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue