0
In the modal next containing two fields of the type date
, "Of: dd/mm/aaaa
and even: dd/mm/aaaa
" I want to set the "From" date for the current date, "Until" for a day difference and in the field time
set a default time.
Fields of the type Date:
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-4 control-label" for="data-inicio-excecao"> Data * </label>
<div class="col-sm-8">
<input type="date" class="form-control" id="data-inicio-excecao" name="data-inicio-excecao" tabindex="2" />
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-4 control-label" for="data-termino-excecao"> Até </label>
<div class="col-sm-8">
<input type="date" class="form-control" id="data-termino-excecao" name="data-termino-excecao" tabindex="3" />
</div>
</div>
</div>
Fields of the type Team:
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-4 control-label" for="hora-inicio-excecao"> Hora Início * </label>
<div class="col-sm-8">
<input type="time" class="form-control" id="hora-inicio-excecao" name="hora-inicio-excecao" tabindex="4" />
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-4 control-label" for="hora-termino-excecao"> Até </label>
<div class="col-sm-8">
<input type="time" class="form-control" id="hora-termino-excecao" name="hora-termino-excecao" tabindex="5" />
</div>
</div>
</div>
How can I do this using Jquery?
What have you done? Put the code there to make it easier to help you.
– user28595
Only use new Date(). toLocaleString() and place value within your inputs.
– PauloHDSousa
can give me an example Paul?
– Anderson Fernandes
I added an answer with the dates. For the time, explain better what you need, I edit the answer.
– Randrade
I need when the modal opens, the Start Time is 8:00 and the Time Until is 6:00, by default. It is possible to change.
– Anderson Fernandes