datepicker

datePicker plugin not working in Phonegap 2.0

不羁的心 提交于 2019-12-17 17:09:32
问题 After upgrading to Phonegap 2.0, the datePicker plugin does not work. The error is: Uncaught TypeError: Cannot read property 'datePicker' of undefined. the error occcurs on the javascript code: window.plugins.datePicker.show({... The DatePicker js file: /** * Phonegap DatePicker Plugin Copyright (c) Greg Allen 2011 MIT Licensed * Reused and ported to Android plugin by Daniel van 't Oever */ if (typeof cordova !== "undefined") { /** * Constructor */ function DatePicker() { this._callback; } /*

Customize DatePicker. Android

一世执手 提交于 2019-12-17 16:59:36
问题 is there the way to customize a DatePicker? That is my Layout-Code. <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" android:orientation="vertical"> <DatePicker android:id="@+id/ad_date_picker" android:layout_height="wrap_content" android

JavaScript: jQuery Datepicker - simple highlighting of specific days, who can help? (source inside)

北慕城南 提交于 2019-12-17 16:39:27
问题 i want to use the Datepicker for highlighting specific dates. Here is my latest code: <script type="text/javascript"> var dates = [30/04/2010, 01/05/2010]; $(function(){ $('#datepicker').datepicker({ numberOfMonths: [2,3], dateFormat: 'dd/mm/yy', beforeShowDay: highlightDays }); function highlightDays(date) { for (var i = 0; i < dates.length; i++) { if (dates[i] == date) { return [true, 'highlight']; } } return [true, '']; } }); </script> my CSS is: #highlight, .highlight { background-color:

beforeShow event not firing on jQueryUI Datepicker

你离开我真会死。 提交于 2019-12-17 16:26:32
问题 No matter what I try, I'm not able to get the beforeShow event to fire on my datepicker. Here's my code: $('#calendar').datepicker({ inline: true, dateFormat: 'mm,dd,yy', beforeShow: function(input, inst) { alert('before'); } }); I've added beforeShowDay and onSelect events to my datepicker, and they do fire correctly. Has anyone else had trouble with this? 回答1: Here's the solution my team came up with so we don't have to remember to modify the jQuery files every time there's an update. Just

how to restrict bootstrap date picker from future date

徘徊边缘 提交于 2019-12-17 16:18:47
问题 I want to restrict the date picker of bootstrap from taking future date.I just want to enable the dates up to today only.How can i achieve this. Here is my code <script> var FromEndDate = new Date(); $(function(){ $('.datepicker').datepicker({ format: 'mm-dd-yyyy', endDate: FromEndDate, autoclose: true }); }); </script> Can any body help regarding this 回答1: Here is a demo of a working solution: http://jsfiddle.net/tjnicolaides/cjp7y/ <script> $(function(){ $('.datepicker').datepicker({ format

getDate with Jquery Datepicker

依然范特西╮ 提交于 2019-12-17 15:57:06
问题 i am trying to get date from my implementation of jquery date picker, add it to a string and display the resulting image in my div. Something however is just not working. Can anyone check out the code and have a look at it? The code is supposed to take the date from date picker, combine it in a string which is to have the necessary code to display tag, images are located in /image and in the format aYY-MM-DD.png, new to this date picker and can't quite get it down yet. <html> <head> <meta

Jquery UI Datepicker not displaying

独自空忆成欢 提交于 2019-12-17 15:54:27
问题 UPDATE I have reverted back to Jquery 1.3.2 and everything is working, not sure what the problem is/was as I have not changed anything else apart of the jquery and ui library versions. UPDATE END I having an issue with the JQuery UI datepicker. The datepicker is being attached to a class and that part is working but the datepicker is not being displayed. Here is the datepicker code I am using and the inline style that is being generated when I click in the input box that has the class "

How to set the date in materialize datepicker

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 15:53:49
问题 I am using materializecss.com Datepicker. When i try to set date with jquery, the date doesn't get set. Here is my Code :- // Materialize Date Picker window.picker = $('.datepicker').pickadate({ selectMonths: true, // Creates a dropdown to control month selectYears: 100, // Creates a dropdown of 15 years to control year format: 'dd/mm/yyyy' }); <input type="text" id="Date" class="datepicker" /> On Click event of a Button , I am setting the date :- $("#Date").val('23/01/2015'); When i open the

Javascript: calculate number of days in month for a given year

点点圈 提交于 2019-12-17 15:51:48
问题 I have a HTML page with 3 dropdowns for the month, day and year and I was wondering if there was a way to populate the month drop down properly depending on the month and year. I haven't done this before on the client side, but it looks like a lot of controls like the jQuery DatePicker are doing that behind the scenes. 回答1: You can play with date objects: var monthStart = new Date(year, month, 1); var monthEnd = new Date(year, month + 1, 1); var monthLength = (monthEnd - monthStart) / (1000 *

jQuery datepicker to prevent past date

萝らか妹 提交于 2019-12-17 15:27:29
问题 How do I disable past dates on jQuery datepicker? I looked for options but don't seem to find anything that indicates the ability to disable past dates. UPDATE: Thanks yall for the quick response. I tried that with no luck. Days were still not grayed out as I expected and still accept the selected past date. I tried this: $('#datepicker').datepicker({ minDate: '0' }); Doesn't work. I tried this: $('#datepicker').datepicker({ minDate: new Date() }); Still doesn't work either. It displays the