简体   繁体   中英

JS datepicker capable of: time, date, datetime, day of week, week of year, month of year etc

I am after a JavaScript lib that either natively supports or may be easily extended to work in a variety of 'date picking' modes, where only the relevant time data is selected:

  • Time of day = 20:00
  • Date = 01/01/2020
  • Datetime = 20:00 01/01/2010
  • Day of week = Monday
  • Week of year = 20
  • Month of year = October
  • Year = 2010

Mind you, what is more important to me is that the UI intuitively conveys the fact that you are selecting a week and not a day, a month and not a datetime etc. Parsing the relevant data out is trivial.

Is anybody aware of any library remotely capable of achieving what I am looking for?

You should check out DateTimePicker . It's mostly just an extension of DatePicker which adds various additional options for picking time.

Here's a link to question from a while ago showing a DatePicker modification that will allow you to select only the month and year.

I think a lot of what you want can actually be achieved by just modifying the options for DatePicker. Hopefully this will at least give you a better idea of how you can modify the original widget options to fit your requirements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM