Javascript date picker to display only one week?

I am looking for data-based Javascript that will allow me to display only one week (instead of the current month).

Ideally, this should be one that can be expanded to a full month view if necessary and vice versa.

In addition, (css based?) Design customization will be a plus.

A jQuery solution would be preferable. I looked briefly at the jQuery datepicker, but it seemed to me that it could only show full months. Please let me know if I am wrong.

+4
source share
3 answers

The jQuery UI date sensor, as noted, cannot be easily configured to display only one week. However, you can use the maxDate and minDate configuration minDate to limit user input. Here is an example of an example of this function .

To answer your specific question, I do not know any datepicker controls that will be displayed for only one week.

+3
source

I'm not sure, but maybe you can customize this http://jqueryui.com/demos/datepicker/

The only ones that show only one week, I do not know anyone :(

Edit: after checking, it shows that based on CSS, I skipped its parameters, but could not find anything to show only one week. Rather, there is one that allows you to choose only one week, although I don’t know what the intended effect is.

0
source

A date picker is redundant if you have only seven options. Just use the drop down list. The nice JavaScript trick is that you can add 1 day to any date and it will automatically handle monthly / yearly rollovers. The following code always gives you the following 7 days (starting today):

 var dates = [new Date()]; for (var i = 1; i < 7; i++) dates.push(new Date(dates[0].getYear(), dates[0].getMonth(), dates[0].getDate() + i)); 
-1
source

All Articles