K
K
Kyrat Farre2015-11-11 14:14:36
JavaScript
Kyrat Farre, 2015-11-11 14:14:36

How can I make the date and time picker appear based on the current date and time?

I made a small form with a date and time selection, but I cannot make the number and time in the fields be displayed depending on the actual current date and time. For example:
Today is the 11th and the time is 14.07,
then the date selection form should display: Today, tomorrow, the day after tomorrow, November 14, November 15, November 16, November 17.
The same thing with time, if it is now 14.00,
the time should be displayed 2 hours ahead: 16.07, 17.07, 18.07, 19.07, and so on until 23.00
If anyone has any ideas, share, if not difficult, I have been dancing with a tambourine for a long time, thank you so much))
Link : jsfiddle.net/jwgqnru7

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Ineshin, 2015-11-11
@IonDen

1. This must be done in JavaScript
2. There is a wonderful Moment.js library for working with dates

M
Maxim Timofeev, 2015-11-11
@webinar

There are many js datepikers that implement this or can implement it. But for each case there will be an individual solution. What do you use to pick a date?
Here are the first things that came to mind:
nazar-pc.github.io/PickMeUp
jqueryui.com/datepicker

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question