jquery-ui-datepicker

How to subclass a specific jqueryui widget method?

﹥>﹥吖頭↗ 提交于 2019-12-03 21:48:03
Since I updated jQueryUI to 1.8 I found a couple of issues in our implementations and I could fix it myself without waiting for a fix on their end if I could find out how to subclass a specific method of the datepicker widget so I call the parent code and then execute my code. I was reading on $.widget but I just can't wrap my head around how that is suppose to work. I tried something like this: $.widget("ui.datepicker", { _showDatepicker: function(input) { alert('Yo'); $.datepicker.prototype._showDatepicker.apply(this,arguments); alert('Hey!'); } }); And all sorts of other variations and

Contact form 7 Datepicker, date range between 2 dates

妖精的绣舞 提交于 2019-12-03 21:46:56
I would like to have two date field in my Wordpress contact form 7. A start-date and an end-date. The fields will be datepickers from the "Contact Form 7 Datepicker" plugin. When visitor has selected a start-date he should only be able to select an end date that is 4 days later then the start-date. How can I achieve this by only using the "contact form 7" form creator? This is the syntax I put in the "contact form 7". Start date charter*: [date* date-start date-format:MM_d_yy] End date charter*: [date* date-end date-format:MM_d_yy] And I added this code to the end of the functions file of the

jQuery DatePicker MVC4 EditorFor

僤鯓⒐⒋嵵緔 提交于 2019-12-03 20:01:44
问题 I need to use datepicker on an EditorFor field. My code for the view is: <div class="editor-label"> @Html.Label("birthDate","birthDate") </div> <div class="editor-field"> @Html.EditorFor(model => model.birthDate, new { @class = "datepicker"}) @Html.ValidationMessageFor(model => model.birthDate) </div> The script: <script type="text/javascript"> $(document).ready( function () { $('.datepicker').datepicker({ changeMonth: true, changeYear: true, minDate: "-99Y", dateFormat: "dd/mm/yyyy" }); });

Highlight current week when datepicker is loaded

两盒软妹~` 提交于 2019-12-03 18:13:55
问题 I am following this jsFiddle to be able to highlight and select whole week from datepicker. I have customized it to work with jQuery 1.9 by changing .live() to .on(). Here is the edited jsFiddle. It works fine but in its current state the week is only highlighted once the user click on a date. What I want to achieve is to highlight (and populate dates in startDate and endDate vars) the week to which current date belongs automatically on startup without clicking current date. I have tried the

jquery datepicker and custom validation

不问归期 提交于 2019-12-03 16:34:14
I need to add custom validation(I think) for validating input from an user. Here's my use case: I'm using the jquery ui datepicker for selecting dates, with localization like this: $.datepicker.setDefaults( $.datepicker.regional[ currentLocale ] ); I use the bassistance validation plugin, and using rules for date:true and such does not work with different formats(or if they do please tell me how!). So I've made my own date validation methods like this $.validator.addMethod("validDate", function(value) { return parseDateString(value) != null; }, jQuery.validator.messages.date); This all works

How do i disable public holidays in a jQuery UI date picker?

試著忘記壹切 提交于 2019-12-03 13:48:48
问题 I'm making a holiday booking application and obviously you don't need to book off holidays that are already given to you, so I need to know how I can disable, Christmas, for example from the date picker every year without me having to change the code every year. This is my jQuery UI date picker code so far: <script> $(function() { $("#from").datepicker({ beforeShowDay: $.datepicker.noWeekends, defaultDate: "today", changeMonth: true, numberOfMonths: 1, minDate: "today", dateFormat: "dd/mm/yy"

Which way to add text to jquery ui datepicker cell?

半城伤御伤魂 提交于 2019-12-03 12:47:36
问题 I need to show custom text on some dates at Jquery UI datepicker , to be more precise, to render a specific price for some dates. My idea was to use beforeShowDay to attach specific price in titles of such dates and then, in beforeShow to check out each td and to place title's text into the cell. Example: var m, d, y, checkDate, specificPrice = ''; var specificPrices = {"2013-3-8":"300 EUR", "2013-2-26":"263 EUR"} $('#my-datepicker').datepicker({ beforeShowDay: function checkAvailable(date) {

Hide ui-datepicker-calendar based on element attribute

坚强是说给别人听的谎言 提交于 2019-12-03 12:31:13
I have multiple inputs on my page, all of which have jQuery UI's datepicker widget attached to them. What I would like to do is show/hide the .ui-datepicker-calendar based on a data-calendar attribute on the input element. For example: <input type="text" data-calendar="false" /> <input type="text" data-calendar="false" /> <input type="text" data-calendar="true" /> So, the first two should not show the .ui-datepicker-calendar , but the last should. I thought I could leverage the beforeShow event to set the display of the element, however, at the time the event fires, the .ui-datepicker-calendar

jQuery UI Picking a start and end date within range based on start date

筅森魡賤 提交于 2019-12-03 11:50:30
I'm building a date picker in jQuery ui. What I'm trying to do is set a range, so when they pick the first date the second date appears and gives a 30 day window. I tried this but it doesn't work (it lets the user pick 30 days from today, not 30 from the start date): var pickDate; $( "#datepickerEnd" ).hide(); $( "#datepickerStart" ).datepicker(); $( "#datepickerStart" ).change(function(){ var pickDate = $( "#datepickerStart" ).val(); $( "#datepickerEnd" ).datepicker({ minDate: pickDate, maxDate: +30 }); $( "#datepickerEnd" ).show(); }) Another issue I ran into is when I change datepickerStart

Create a label using jQuery on the fly

我们两清 提交于 2019-12-03 10:33:53
I need to create a label and text field on the fly and also include datepicker for the textfield. I need something like this: <label for="from">From </label> <input type="text" id="from" name="from" /> I have tried something like this in jQuery: var label = $("<label>").attr('for', "from"); label.html('Date: ' + '<input type="text" id="from name="from" value="">'); $(function() { $("#from").datepicker(); }); This one somehow doesn't create the label and also the text field. I am not sure what I am missing. EDIT To be more precise, I am using this in the portlets and I don't have body tags in