jquery-ui-datepicker

Can the jQuery UI Datepicker be made to disable Saturdays and Sundays (and holidays)?

删除回忆录丶 提交于 2019-11-25 22:35:08
问题 I use a datepicker for choosing an appointment day. I already set the date range to be only for the next month. That works fine. I want to exclude Saturdays and Sundays from the available choices. Can this be done? If so, how? 回答1: There is the beforeShowDay option, which takes a function to be called for each date, returning true if the date is allowed or false if it is not. From the docs: beforeShowDay The function takes a date as a parameter and must return an array with [0] equal to true

jQuery UI DatePicker to show month year only

隐身守侯 提交于 2019-11-25 22:33:09
问题 I am using jQuery date picker to display the calendar all over my app. I want to know if I can use it to display the month and year (May 2010) and not the calendar? 回答1: Here's a hack (updated with entire .html file): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.js"></script

Jquery UI datepicker. Disable array of Dates

只谈情不闲聊 提交于 2019-11-25 22:28:27
问题 I have been trying to search for a solution to my Jquery ui datepicker problem and I\'m having no luck. Here\'s what I\'m trying to do... I have an application where i\'m doing some complex PHP to return a JSON array of dates that I want BLOCKED out of the Jquery UI Datepicker. I am returning this array: [\"2013-03-14\",\"2013-03-15\",\"2013-03-16\"] Is there not a simple way to simply say: block these dates from the datepicker? I\'ve read the UI documentation and I see nothing that helps me.

jQuery UI DatePicker - Change Date Format

醉酒当歌 提交于 2019-11-25 21:49:35
问题 I am using the UI DatePicker from jQuery UI as the stand alone picker. I have this code: <div id=\"datepicker\"></div> And the following JS: $(\'#datepicker\').datepicker(); When I try to return the value with this code: var date = $(\'#datepicker\').datepicker(\'getDate\'); I am returned this: Tue Aug 25 2009 00:00:00 GMT+0100 (BST) Which is totally the wrong format. Is there a way I can get it returned in the format DD-MM-YYYY ? 回答1: Here's one specific for your code: var date = $('