Kendo UI datepicker to capture by week - javascript

I need to capture weeks instead a dates using Kendo UI datepicker. I need some like this (plz see the picture):
Someone can give me the solution? I need to get the week number after select the week. any help? thank you in advance.

set the weekNumber to true.
$("#datepicker").kendoDatePicker({
weekNumber: true,
});

This isn't available in KendoUI at the moment.
It's been requested on the community forums and it looks like its still pending.
http://kendoui-feedback.telerik.com/forums/127393-telerik-kendo-ui-feedback/suggestions/2952881-add-the-ability-to-display-a-week-number-column-to
Add the ability to display a week number column to the Calendar & DatePicker controls and permit custom calculation of week number.

Related

ReactJS Ant Design - Use Range Picker as Multi Month View with Single date selection

I have a requirement of implementing Multiple Month View which shows two months calendar side by side exactly like RangePicker but to be able to choose only single date, not a range.
I have made a Sandbox
If anyone has worked on such solution, please help.
Thanks.
I worked on something similar recently. I made an override to the Ant CMS for the range selection blue background. I just kept the styling for the dates that are clicked, and I just kept the two selected dates instead of the entire range.
It's a hack, but it worked fine and I've yet to run into any issues with it.
Set allowEmpty={[false, true]} disabled={[false, true]}
Demo

Show week number in Datebox Plugin

I'm using JQueryMobile's Datebox plugin. Its simply an awesome tool and I use it even for date conversion.
Now the problem is to show the Week Number in the date picker along with the Month calender that shows up.
Is there any way to do it in Datbox or anyother plugin available for it?
Thanks for your time in advance
sorry it took so long, but here ya go:
http://dev.jtsage.com/jQM-DateBox2/demos/mode/calbox.html (2nd demo)
I believe that is what you are looking for - let me know if it works out.

jQuery ui datepicker, select range of whole weeks only

I need to create a jQuery ui datepicker that will let users choose a start week of the year, and an ending week of the year. IE: Always Sunday - Saturday. Is this possible?
DatePicker can restrict a user's selection, but only as far as restricting the user between two dates (minDate and maxDate options). As far as I'm aware, there's no built in functionality that can restrict selection to only Sundays or Saturdays.
DatePicker does however have a means of calculating the week of a user's selection with the following snippet of code:
$.datepicker.iso8601Week(new Date(dateText))
You can see how this could be utilised in the following jsFiddle (read below, first).
The only problem with this is that the ISO-week always starts with a Monday. So even though in the demo above I have set Sunday to be the first day of the week, if you try selecting the date Wed 7th March 2012 you'll see in the datapicker it shows as week 9, where the ISO-week will return 10. I left it in on purpose to show you this pitfall.
Although this doesn't provide a direct solution to your problem, hopefully it'll help in determining if you should use DatePicker at all to produce your desired functionality.
edit
Actually, just found this question which might be of use to you, looks like it's possible : Can the jQuery UI Datepicker be made to disable Saturdays and Sundays (and holidays)?

jQuery Datepicker beforeShowDay - range selected

I'm doing a website for an hotel, and I'm trying to do a datepicker to book the days that somebody wants to stay there.
http://jsfiddle.net/newpatriks/PmPGV/
Here you have that I have done, but I've some problems:
I don't know why, but when the users select the range days, the calendar starts from the month that contains the "end day" choosen.
The css run ok for the .temp_1, but not going well for the .temp_2 and .date_selected (I'm going crazy about this...)
Thanks a lot :)
JQuery Datepicker has a built in range select: datepicker/date-range.
Here is an example from the following question: jQuery datepicker- 2 inputs/textboxes and restricting range

Javascript date picker for displaying one week only?

I am looking for a Javascript-based date picker that would allow me to display one week only (instead of the current month).
Ideally it should be one that can be expanded to a full month view if necessary and back again.
Also, (css based?) design customizability would be a plus.
A jQuery solution would be preferred. I've had a brief look at the jQuery datepicker, but it seemed to me that it can only display full months. Please let me know if I am wrong.
The jQuery UI datepicker, as has been noted, can not easily be configured to display only one week. You can however use the maxDate and minDate configuration options to constrain the user's input. Here is an example of this functionality.
To answer your specific question, I am not aware of any datepicker control which will only display one week.
I'm not sure, but maybe you can customize this http://jqueryui.com/demos/datepicker/
Ones that show just one week I know none :(
Edit: After inspect, it shows to be CSS based, I've run through it's options but couldn't find anything just to show one week. Rather there is one which allows you to select only one week though, dunno what the supposed effect is though.
A date picker widget is overkill if you only have seven options. Just use a dropdown. A neat JavaScript trick is that you can add 1 day to any date and it will handle month/year rollovers automatically. The following code will always give you the next 7 days (starting with 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));

Categories

Resources