Menu
  • HOME
  • TAGS

how can I get the date picker to start select from at least 8 previous days back from this days date?

jquery,twitter-bootstrap,date,datepicker

I found a better solution: I used the setDate to set the date i want $(".date-picker").datepicker("setDate", "-20d"); And used the endDate, so people only can choose dates 20 days back from the current date(todays date). endDate: '-20d' Thanks, for your time!...

Bootstrap datepicker: Disable past date after first is set

jquery,twitter-bootstrap,datepicker

After trying and trying I finally got a solution for this so I am sharing here in case someone also need this: Working jsfiddle $( ".line" ).each(function(index, element) { var startDate = new Date(); var fechaFin = new Date(); var FromEndDate = new Date(); var ToEndDate = new Date(); /*...

Bootstrap Modal + Datepicker + Form Values

jquery,forms,twitter-bootstrap,datepicker,bootstrap-modal

The datepicker you are using also has a show event and the modal trigger show.bs.modal runs again. A workaround for this is to put a simple check and if f.relatedTarget is undefined the trigger is from the datepicker. $('#form-update-task').on('show.bs.modal', function(f) { if (f.relatedTarget === undefined) return; // Do other stuff...

Bootstrap 3 DatePicker - How to reset selected date without resetting the picker configuration?

jquery,twitter-bootstrap,datepicker

You need to get the current datePicker instance and call setDate(null) on it. you can do it like this: $("#clear").click(function(){ $('#myDatepicker').data('datepicker').setDate(null); }); updated fiddle: http://jsfiddle.net/4L6fhjLf/2/...

Why has Chrome on Android's native HTML5 date picker become really slow?

android,html5,google-chrome,meteor,datepicker

See crbug.com/441060 . You can avoid this slowness by specifying min= and max= attributes.

Angularjs filter ng-repeat by datepicker

angularjs,datepicker,angularjs-filter

Change your code from <div ng-repeat="item in items | filter: date_picker"> to <div ng-repeat="item in items | filter: {date_only:dt}"> Assuming that ng-model=dt is your search criteria and property searched against is item.date_only and also both above object has same type ( comparable ). More info check https://docs.angularjs.org/api/ng/filter/filter...

Convert String to NSDate when using DatePicker and TextField

ios,swift,datepicker

let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "MMM dd, yyyy 'at' h:mm:ss a" if let date = dateFormatter.dateFromString("May 31, 2015 at 12:30:15 PM") { println(date) } if you need some reference for date formatting you can use this one: ...

Bootstrap Datepicker not displaying correctly

asp.net-mvc,twitter-bootstrap,datepicker

As Jasen has pointed out i'd missed the css resource I'm the bundle config. Thanks

Activate bootstrap date picker on injected element

javascript,jquery,twitter-bootstrap,datepicker,bootstrap

I think you need to make sure that the datepicker is initialized after adding the <input> field to the modal dialog. Perhaps this example might help. function injectDatePicker() { var input = $('<input />'); input.datepicker({ format: "dd/mm/yyyy" }); $('#mountPoint').append(input); } <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" /> <link href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.0/css/bootstrap-datepicker.min.css" rel="stylesheet" /> <script...

Using Bootstrap Datepicker Internationally

twitter-bootstrap,datepicker,internationalization

From what the docs say here the following format is acceptable: "06-01-2012" Making your HTML look like so: <input id="myDatePicker" class="form-control input-sm" type="text" autocomplete="off" value="06-01-2015"> ...

Datepicker for date of birth input field

javascript,php,datepicker

You can use Jquery date picker. Look at this https://jqueryui.com/datepicker/ You just need to use ("#inputField").Datepicker() Place your html anywhere in the form. The line above should go inside script> tag Update You need to include jquery files like this in your page's header section <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script>...

How to verify if specific date is monday in php

php,jquery,date,datepicker

If you want to find out if a given date is a day of the week, use the "D" flag for the date function. if(date('D', $unixTimestamp) === 'Mon') { //Do what you want here } You can find more details on the PHP manual page for the date function here...

How to use the bootstrap datepicker?

javascript,jquery,angularjs,twitter-bootstrap,datepicker

Have that input field an id or a class which you will use as a selector once you call the datepicker. in your html: <input type="text" type="text" class="datepicker"> in your JS: $('.datepicker').datepicker(); ...

Texbox to accept year greater than 18 years

asp.net,datepicker

Got it than by my own, See the maxDate property. $(function () { // Only allow dates greater than 18 years ago to be accepted $("#txtBirth").datepicker({maxDate: "-18y"}); });...

Mulit jQuery UI Datepickers with different settings

javascript,jquery,jquery-ui,datepicker

You have to use the second selector first. DatePicker doesn't allow you to apply it twice on the same element, so you have to put specific datepicker selector first then more general ones that applies datepicker on other dp elements: // Additional settings $("input.date-picker.multi-calendars").datepicker({ numberOfMonths: 3 }); //Datepicker $("input.date-picker").datepicker({ });...

fuelux : start datepicker on monday

datepicker,culture,fuelux

It should be, per datapicker options: $('#myDatepicker').datepicker({ momentConfig: { culture: 'fr', format: 'L' } }); However, this will only set the format of the input box--not the calendar. I'm not sure if there is a way to have the calendar start on Monday (you can change the day names at...

Select date from and date to in the same date-picker JQuery UI datepicker

javascript,jquery,jquery-ui,date,datepicker

Check this out. It's a bit older but it should work: http://bseth99.github.io/projects/jquery-ui/4-jquery-ui-datepicker-range.html...

DatePicker block out weekends

jquery,datepicker

I think this is a very dirty hack that you can come over with: $("#datepicker").datepicker({ dateFormat: 'dd/mm/yy', beforeShowDay: $.datepicker.noWeekends, minDate: 0, maxDate: (function () { var today = new Date().getDay(), add = 0; switch (today) { case 0: add = 1; break; case 4: case 5: case 6: add =...

validate jquery datepicker

jquery,html,jquery-ui,datepicker

EDITED : You can following my code below : HTML Date From : <input type="text" name="datefrom" id="inputdate2" required> <button type="button" id="btn"> Submit </button> JS $(function() { $("#inputdate2").datepicker({ dateFormat: 'yy-mm-dd' }); $("#btn").on('click', function(){ if($("#inputdate2").val() == '') { alert("Please Select Date First!"); } }); }); you can check my result from JSFiddle...

AngularJS Filter Value From DatePicker

jquery,angularjs,datepicker

It works with these additions to the HTML/Javascript and Controller: HTML/Javascript: <script> $('#myFirstDate').datepicker({ startDate: '+1d', todayHighlight: true }).on('changeDate', function(e){ var theDate= $('#myFirstDate').datepicker('getDate').toString(); var regex = /[A-Z]\w+/; theDate = regex.exec(theDate)[0]; console.log(theDate); var element = angular.element($('#myFirstDate')); var controller = element.controller(); var scope = element.scope(); scope.$apply(function(){ scope.theDate = theDate; }); }); </script> <div...

jqueyr datetimepicker set to date depand on from date

javascript,php,jquery,datetime,datepicker

if I understand correctly, you have something like this: a) a select box like this Options : <select id="time"> <option value="1">Weekly (7+ days)</option> <option value="2">Monthly (30+ days)</option> <option value="3">Half Yearly (6+ months)</option> <option value="4">Yearly (1+ Year)</option> </select> b) and two date pickers, like this: Select From Date : <input id="start_date"...

Bootstrap datepicker: The format is changed to default

javascript,twitter-bootstrap,jsf,datepicker

I solved it now by adding this String js = "$('.datepicker').datepicker({format: 'dd.mm.yyyy', autoclose: true});"; RequestContext.getCurrentInstance().execute(js); to every validator method and submit method....

Wpf DatePicker validation error on startup

c#,wpf,validation,datepicker

You could write your own ValidationRule to use with DatePicker. Let's say you have nullable DateTime property in your viewmodel, e.g. public class MainViewModel : ViewModelBase { public MainViewModel() {} public DateTime? EffectiveDate { get; set; } } And in your XAML you have ... xmlns:rules="clr-namespace:YourNameSpace.ValidationRules" ... <DatePicker x:Name="EffDatePicker"> <DatePicker.SelectedDate>...

jquery ui datepicker not working with tabs

php,jquery,jquery-ui,tabs,datepicker

You're going to want to tap into the activate event if you've got this hosted in a tab (don't see it in the code, but it's in the question?). See jQuery UI Tabs Widget documentation. You're going to want to add, in activate or in your loadGrid() function, something to...

Jquery Enable/Disable checkbox

javascript,jquery,datepicker

try $('.current-work-status').change(function () { $(this).closest('div').prev().find('.form-control-2').prop('disabled', this.checked); }); updated fidle...

Calendar with DatePicker always returns last month even if I add + 1

java,android,datepicker,calendar

onDateSet() gets called with zero-based month as mentioned in the documentation: monthOfYear The month that was set (0-11) for compatibility with Calendar. You need to adjust the month value there, too....

Why are Angular date pickers so slow?

javascript,angularjs,datepicker,bootstrap-datepicker

Since I couldn't find an efficient AngularJS datepicker I switched to using a standalone one that doesn't block the AngularJS digest: https://github.com/dbushell/Pikaday. My application is now much faster. As for the suggestions in the comments, I don't see how a wrapper would make anything faster (more code = less speed),...

Can't position Bootstrap date picker in the right position

twitter-bootstrap,datepicker,bootstrap-datepicker

use this put calendar and submit in separate div <div class="container"> <form class="form-inline" role="form"> <div class="form-group col-sm-2"> <label label-default="label-default" for="Qty">Qty</label> <span class="addon glyphicon glyphicon-user"></span> <select class="form-control input-sm" id="Qty"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> </div> <div class="col-xs-2 ">...

Twitter Bootstrap: How to disable dates before a selected date dynamically

javascript,jquery,twitter-bootstrap,datepicker

Hi here I have try to do like this : Bootstrap DatePicker HTML: <input type="text" class="from_date" placeholder="Select start date" contenteditable="false"> <input type="text" class="to_date" placeholder="Select end date" contenteditable="false"> JS: var startDate = new Date('01/01/2012'); var FromEndDate = new Date(); var ToEndDate = new Date(); ToEndDate.setDate(ToEndDate.getDate()+365); $('.from_date').datepicker({ weekStart: 1, startDate: '01/01/2012', endDate:...

Capturing a value in a jQuery UI datepicker and alerting it back to the user

javascript,jquery,jquery-ui,datepicker

Change the datepicker part of code to this: var prevDate = null; $("#date1").datepicker({ changeMonth: true, changeYear: true, onSelect: function(date) { if (prevDate === null) { alert('User has selected ' + date); } else { alert('User has change ' + prevDate + ' to ' + date); } prevDate = date;...

How can I change the zIndex attribute of aui-datepicker in Liferay Portlet 6.2

datepicker,liferay,z-index,liferay-aui,alloy-ui

You need to change the zIndex on the DatePicker's internal Popover: new Y.DatePicker({ // ... popover: { zIndex: 1 } }); See the example page and API docs for more details....

How to use datepicker in dynamically created jQuery UI dialog?

javascript,jquery,jquery-ui,datepicker,dialog

The problem was that the subpage can not reload jquery.js and jquery-ui.js. So here my solution: index.html <html> <head> <script type="text/javascript" src="./js/jquery-1.11.2.min.js"></script> <script type="text/javascript" src="./js/jquery-ui.js"></script> <script type="text/javascript"> $(document).ready(function() { var $loading = $('<img src="./images/loading.gif" alt="loading">'); $('.page-popup').each(function() { var $dialog =...

Formatting Date from JSON to Datepicker field

javascript,jquery,json,date,datepicker

Your error is because there is no format method on a Date object. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date You have to write your own formatting code or use a library like http://momentjs.com/ var jsonDate = "/Date(1454519004200)/" var BoardStart = new Date(parseInt(jsonDate.replace("/Date(", "").replace(")/", ""), 10)); console.log(moment(BoardStart).format('MM-DD-YYYY')) <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.js"></script> ...

Running into problems using React Datepicker with rails

javascript,ruby-on-rails,datepicker,reactjs

Just resolved it, it was a matter of not requiring the "moment" js file in application.js. If you use bundler to install this plug in be sure to add the following into the gemfile: source "https://rails-assets.org" do gem 'rails-assets-react-date-picker' gem "rails-assets-moment" end and then require both in application.js in this...

Comparing dates using Dynamic Action on DatePicker Oracle Apex

oracle,dynamic,datepicker,action,oracle-apex

As @ScottWe mentions: you're trying to apply PLSQL logic in HTML/javascript. The 'When - Condition' is evaluated at runtime and thus you can't use PLSQL there. The date arithmetic is a bit annoying in javascript though, so if you're a unfamiliar with it, here is a way you can perform...

Start DatePicker Dialog from specific Date

android,datepicker

To hide everything after 1995, you coud use JodaTime and set the max date like this: dialog.getDatePicker().setMaxDate(new DateTime(1995, 0, 0, 0, 0).getMillis()); ...

IE Input type Date not appearing as Date Picker

internet-explorer,date,datepicker

You need to use a ployfill so that the input type DATE has a consistent behaviour in all browsers. You can use this webshim as a polyfill. Input type DATE is an HTML5 feature which is not supported by all browsers. In case you want to use HTML5 feature not...

how to find the hours between two dates in jquery?

jquery,datepicker

I would use the valueOf() function which removes any possible errors due to daylight saving time etc - it converts dates to a number of milliseconds since 1970. But you;ll need to format your date in an unambiguous way, 12-05-2015 will be taken as 5th December 2015 . Use '2015-05-12'...

Clearing the Kendo Datepicker input field from the footer

javascript,jquery,kendo-ui,datepicker

I was able to do this using the "remove link" example here: http://www.telerik.com/forums/datepicker-custom-footer-without-link My new code: <input id="datepicker" /> <script id="footer-template" type="text/x-kendo-template"> #=text# </script> <script> $("#datepicker").kendoDatePicker().getKendoDatePicker().one("open", function(e) { var t = kendo.template($("#footer-template").html()); var dp = this; setTimeout(function(){ dp.dateView.popup.wrapper.find(".k-footer").append(t({text: "<button id=\"myButton\"...

Date incrementing issue in bootstrap date picker

javascript,angularjs,date,datepicker,bootstrap-datepicker

As explained in toISOString() documentation, this function returns the date (timestamp) in the zero UTC offset. The timestamp you are providing is in the "India Standard" time zone. So that those two dates are representing the same exact moment, but one is showing the time at the Greendwich meridian and...

Struts2 jqGrid DatePicker in Column Filter

jquery,jsp,struts2,jqgrid,datepicker

I figured out the solution: Step 1: Add datepicker javascript to head tag... after the sj:head tag. <script type="text/javascript" src="javascript/jquery.ui.datepicker.min.js"></script> Step 2: Create a function that will be called from the sjg:gridColumn tag. searchDatePick=function(element) { $(element).datepicker(); }; Step 3: Add the searchoption property to your sjg:gridColumn tag. Reference the variable...

angularjs datepicker directive “Missing instance data” on dynamic form fields

jquery,angularjs,jquery-ui,datepicker

By adding a console.log() in the directive I was able to determine that the angularjs html compiler wasn't able to compile the dynamic id. console.log("xxxxxx-1 " + $(element)[0].id); regardless of how many household members I created they all had the same id: xxxxxx-1 HOUSEHOLD{{ $index + 1 }}_dob By setting...

Jquery Date - determine a sunday?

javascript,jquery,datepicker

As I can see, you are using Keith Wood Datepicker Plugin which is very similar to jquery UI plugin. In this case, your onSelect function receives the date Object as mentioned in: The function is called when each date is selected and receives the currently selected dates (Date[]) as the...

How can I disable DatePicker from viewmodel WPF MVVM

c#,wpf,mvvm,datepicker

One way to achieve this is, adding a property to the ViewModel and binding IsEnabled property of the DatePicker to that. Then you need to set the property inside the setter of Urgent property: (assuming that you have a property named Urgent in your ViewModel): class YourViewModel { private bool...

How do I keep the datepicker field empty on load?

javascript,jquery,datepicker,bootstrap

Try this code <input type="text" id="example1"/> <script type="text/javascript"> // When the document is ready $(document).ready(function () { $('#example1').datepicker(); $('#example1').val(""); }); </script> Hope this will help you....

JQuery Datepicker doesn't change input value

javascript,jquery,jquery-ui,datepicker

You are confusing the inline value attribute with the actual value that the input field contains. By the attribute value, I mean the following: <input id="deliveryTime" name="deliveryTime" type="text" value="08/05/2015 10:00"> The value attribute is value="08/05/2015 10:00". The value could be whatever date you picked that is entered into the input...

jQuery UI Datepicker set display month

jquery,jquery-ui,datepicker

Assuming you have mm/dd/yyyy mask, like in the demo you could do like this: UPD2. Using Datepicker API function ChangeMonth(month) { var initialVal = $('#datepicker').datepicker('getDate') curMonth = date.getMonth(), if(month > 0 && curMonth < 12){ initialVal.setMonth(curMonth + 1) } if(month < 0 && curMonth > 1) { initialVal.setMonth(curMonth - 1)...

Can't access DatePicker.ValidationCallback in my code

java,android,datepicker,android-widget

That was introduced around API version 21. If you MinSDK is lower you won't have visibility to that feature. However I just tested this by creating a sample project from scratch setting the min/max SDK to 22 and I still don't have visibility to that method. Potentially this is a...

DatePicker BlackoutDates all future and some past

wpf,datepicker

Thanks so much for both of you quickly replying. I was actually able to figure this out using DateTime.MaxValue and DateTime.MinValue and having two CalendarDateRanges in my DatePicker.BlackoutDates tags. Sometimes you just need to post a question to think about it in a different way :) Thanks again guys. Here's...

How to target multiple datepicker in a form?

javascript,jquery,datepicker

If I've understood this correctly, you want N number of pairs of datepickers ("from" and "to"), which you need to tie together. Essentially, you need a way to go from a specific datepicker and identify only the one other datepicker that's tied to it. There are a number of ways...

jQuery datepicker - code won't work?

javascript,jquery,jquery-ui,datepicker

They aren't working for you locally because you are running them from a file with a url like file:///Macintosh HD/whatever.... You need to change the lines: <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> to: <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script...

Disable all Dates in Zebra Date Picker jQuery Plugin prior to a Date

jquery,datepicker

Why not use the direction-option? You can specify a date for that: $('input').Zebra_DatePicker({ direction: ['2015-04-21', false] }); From the docs: Dates can be selected in the future, starting with a specific date Demo...

how to setText from value of DatePickerDialog

android,datepicker,settext,android-datepicker

You need to initialize the variable v before using it in onDateSet(), e.g. adding the following statement before v.setText(...): v = (TextView) findViewById(R.id.t1); v.setText(new StringBuilder() // Month is 0 based so add 1 .append(mMonth + 1).append("/").append(mDay).append("/") .append(mYear).append(" ")); But in order to insert this statement inside onDateSet(), I suggest you...

quick way to add checkbox jQuery UI datepicker

jquery,jquery-ui,datepicker

You have to set the button panel of datepicker in order to target it using var buttonPane = $(input).datepicker("widget").find(".ui-datepicker-buttonpane");: showButtonPanel: true, But as your image suggests it, you don't want the button panel, so use instead: var buttonPane = $(input).datepicker("widget"); DEMO ...

Showing Jquery Variable in HTML

jquery,html,jquery-ui,datepicker

$('#nights') selects the <span id="nights"></span> element. Only form inputs have the .val() method. What you're looking for is .text() which is used for inserting text nodes into $('#nights').text(diff); Note that .html() would work as well $('#nights').html(diff); But, .html() causes the value to be rendered as HTML, which could be slightly...

Two separate text fields using a DatePicker instead of keyboard in IOS

ios,swift,datepicker,uitextfield

Please check below code - func updateDateField(sender: UIDatePicker) { if sender == datePicker { dateField.text = dateFormat.stringFromDate(sender.date) } if sender == datePicker2 { delivery.text = dateFormat2.stringFromDate(sender.date) } } ...

How to make a disabled DatePicker look like its enabled

css,javafx,datepicker

Solved I used in my code: myDp.setDisable(true); myDp.setStyle(" -fx-opacity: 1.0;"); myDp.getEditor().setStyle("-fx-opacity: 1.0;") when I want that it looks like if it's disabled, while if I want that it looks like if it's disabled: myDp.setStyle(" -fx-opacity: 0.4;"); myDp.getEditor().setStyle("-fx-opacity: 0.4;") thanks to ItachiUchiha...

How execute directive logic after AngularJS template is evaluated?

javascript,angularjs,angularjs-directive,datepicker

Try use $timeout directives.directive('datepicker', ['$timeout', 'Commons', function($timeout,Commons) { return { restrict: 'A', require: 'ngModel', link: function(scope, element, attrs) { $timeout(function() { element.datepicker({ onSelect : function(dateText, obj) { var modelPath = $(this).attr('ng-model'); Commons.putObject(modelPath, scope, dateText); scope.$apply(); } }).datepicker($.datepicker.regional['fr']).datepicker( "option", "dateFormat", "dd/mm/yy").datepicker( "option", "showAnim", 'clip'); })}}; } ]); use $timeout to queue...

Bootstrap Datepicker - Set default picker date, NOT display value

jquery,twitter-bootstrap,datepicker

Here it is: $('.datepicker').datepicker({ defaultViewDate: {year:2000, month:0, day:1}, }); And the js Fiddle: https://jsfiddle.net/mb34zwg3/...

what is the order for jquery in head tags

javascript,jquery,asp.net,datepicker,jquery-autocomplete

You have duplicate references for Jquery library remove one and both should work. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> </script> And <script src="../SearchBoxJS/jquery-1.10.2.js"></script> Remove one of them i would recommend to remove first because it is being referenced from internet and it may load slow and cause errors....

Datepicker set today's day as a default

javascript,jquery,datepicker,set,default

do this: function updateWeekDay($datepicker){ var seldate = $datepicker.datepicker('getDate'); var day = seldate.getUTCDay(); var weekday=new Array(); weekday[0]="Maandag"; weekday[1]="Dinsdag"; weekday[2]="Woensdag"; weekday[3]="Donderdag"; weekday[4]="Vrijdag"; weekday[5]="Zaterdag"; weekday[6]="Zondag"; var dayOfWeek = weekday[day]; $('#DagWeek').val(dayOfWeek); }; $( "#datepicker" ).datepicker({ dateFormat: "dd-mm-yy", onSelect: function(){ updateWeekDay($(this)); } }); var myDate = new Date(); var month = myDate.getMonth() + 1; var...

Do event after click , Datepicker bootstrap

javascript,jquery,twitter-bootstrap,datepicker

Bootstrap datepicker raises a changeDate event when a selection is made. You can use on to hook to that: $('.datepicker').datepicker({ startDate: "auto", todayHighlight: true }).on('changeDate', function() { alert($(this).val()); }); Updated fiddle...

Spanish location for yii2-date-picker-widget

datepicker,yii2

Your translation doesn't work because of wrong syntax, You should move Your language param from 'clientOptions' to top level array: <?= $form->field($model, 'alta')->widget( DatePicker::className(), [ 'inline' => false, 'language' => 'es', 'clientOptions' => [ 'format' => 'yyyy-mm-dd', 'weekStart' => 1, 'todayBtn' => 'linked', 'clearBtn' => true, 'autoclose' => true, 'todayHighlight'...

swift: send value back to UITableViewController from dynamic cell with UIDatePicker

swift,datepicker,tableview,tableviewcell

You can use NSUserDefaults for storing values globally which can access anywhere into your project. you can set values this way for your picker. NSUserDefaults.standardUserDefaults().setObject("YouValueForm", forKey: "YourKey") After that you can access this value anywhere in your project this way: let yourVar = NSUserDefaults.standardUserDefaults().objectForKey("YourKey") as! String You can modify this...

Format date shown on DatePicker

date,datepicker,windows-phone-8.1,format

The DatePicker format is using user's preferred language and region. This control will automatically look different, for my region it's day/month/year like you wish it to be. I've tried to force the control to use other language, but it seems to be taking it directly from phone settings. Some information...

Retrieve date from DatePicker and move to another FXML file

javafx,datepicker

You can't use the singleton pattern here because the FXMLLoader essentially creates an instance of DiscountController by calling the no-argument constructor (i.e. not by calling DiscountController.getInstance()). (You could go this route if you really wanted, by setting a controller factory on the FXMLLoader that loaded the discount FXML file, but...

Android: How to change the color of the dateselector in Datepicker widget?

android,colors,datepicker,calendar,selector

Okay I think I got it. I tried desperately to find an attribute in MyDatePickerStyle. The solution came to my mind when I rethought the whole inheritance hierarchy. I just had to add the colorAccent to the MyDatePickerDialogTheme. <style name="MyDatePickerDialogTheme" parent="Theme.AppCompat.Light.Dialog"> <!-- this is new --> <item name="colorAccent">@color/accent</item> <item name="android:datePickerStyle">@style/MyDatePickerStyle</item>...

Datepicker with class selector - range functionality should only work inside the unit

jquery,datepicker

That's because in the onClose callbacks you are selecting .period-start, which selects all elements with that class on the page. What you want to do is only search for the one within the same unit. Something like this: // onClose callback for period start onClose: function(selectedDate) { $(this) .closest('.unit') .find('.period-end')...

Datepicker not showing days - Bootstrap

javascript,jquery,html,twitter-bootstrap,datepicker

DEMO Ok. The problem was with your below line: ("tr:not(:has(>th))").show().filter inside FilterLoggingTable() function. What this does is hides or shows all the trs in the page when criteria is matched!Now why this effects your calendar is because the bootstrap creates table for your calendar when you initialize the datepicker and...

Datepicker is automatically disappearing

jquery,twitter-bootstrap,datepicker

Sad to say, there seems to be no option for preventing this. The guilty code is line 372-384 : [$(document), { mousedown: $.proxy(function(e){ // Clicked outside the datepicker, hide it if (!( this.element.is(e.target) || this.element.find(e.target).length || this.picker.is(e.target) || this.picker.find(e.target).length )){ $(this.picker).hide(); } }, this) }] You need to modify that....

jQuery ui datepicker in direction rtl page - position issue

jquery,user-interface,datepicker,right-to-left

From this link you can try it as below: DEMO Initialize the datepicker with the isRTL option specified: $( ".selector" ).datepicker({ isRTL: true }); Get or set the isRTL option, after initialization: // Getter var isRTL = $( ".selector" ).datepicker( "option", "isRTL" ); // Setter $( ".selector" ).datepicker( "option", "isRTL",...

disabling specific dates from html datepicker jquery

javascript,jquery,web,datepicker

Try this, run this code below. The first date I added a 0 to the day so that it will match the formatting in the comparison. /** Days to be disabled as an array */ var disableddates = ["20-05-2015", "12-11-2014", "12-25-2014", "12-20-2014"]; function DisableSpecificDates(date) { var string = jQuery.datepicker.formatDate('dd-mm-yy', date);...

Magento date picker is not working when current date is disable

javascript,php,magento,datepicker

Finally I got the solution. In js/calendar/calendar.js there is a variable currentDateEl. By default it is null.You just need to set this.currentDateEl to current date. var currentDate = new Date(); var day = currentDate.getDate(); var month = currentDate.getMonth() + 1; var year = currentDate.getFullYear(); var dmy = day + "/"...

how to put datepicker in controller in yii

php,jquery,ajax,yii,datepicker

You can use Jquery ui which will work on the input class or id text field code $data .= CHtml::textField('LeaseAgreement[lease_agrmnt_id][]', '', array('maxlength'=>'300','class'=>'datepicker')).'</div>'; jquery <script> $(function() { $( ".datepicker" ).datepicker(); }); </script> you may need to include jquery Ui files for this ....

Display Datetime picker on tiny mce plugin

javascript,jquery,jquery-ui,datepicker,tinymce

Here's a solution: $(document).ready(function() { tinymce.init({ selector: "textarea", toolbar: "insertfile undo redo | styleselect | bold italic | datepicker", setup: function(editor) { editor.addButton('datepicker', { type: 'button', classes: 'MyCoolBtn', text: 'Datepicker', tooltip: 'Pick a date', onClick: function() { $('#datepicker').datepicker('show'); }, //icon: true, }); } }); $("#datepicker").datepicker({ onSelect: function(dateText, inst) { //...

Bootstrap Datepicker maximum selection of N days

javascript,jquery,twitter-bootstrap,datepicker

Based on the documentation for the bootstrap-datepicker plugin you are using, it looks like if you just do multidate: 5 "the picker will limit how many dates can be selected to that number, dropping the oldest dates from the list when the number is exceeded." $('#datepicker').datepicker({ multidate: 5 }); As...

jQuery datepicker on dynamically generated rows

javascript,jquery,html,datepicker

You have to initiate the datepicker after the new rows are created jQuery(function($) { //create a original copy of the row to clone later var $tr = $('table.table-responsive tr.cloneme:first').clone(); //add dp to existing rows addDP($('input.datepicker')); $('#addNew').on('click', function() { var clone = $tr.clone(); console.log(clone); clone.append("<td><button class='deleteAdded btn btn-danger'>Remove</button></td>"); //add dp to...

How to set the date in materialize datepicker

javascript,jquery,datepicker,material-design

Materialize datepicker is a modified pickadate.js picker. Accodging to their API docs, this is how to set the picker: Get the picker: var $input = $('.datepicker').pickadate() // Use the picker object directly. var picker = $input.pickadate('picker') Set the date: // Using arrays formatted as [YEAR, MONTH, DATE]. picker.set('select', [2015, 3,...

angular-ui datepicker max-date doesn't work properly

javascript,angularjs,datepicker,angular-ui

<datepicker ng-model="dt" minDate="'05/01/2015'" datepicker-options="dateOptions" class="well well-sm" custom-class="getDayClass(date, mode)"></datepicker> try this, put the minDate in the markup

create jquery array for ajax post

javascript,jquery,ajax,datepicker

Update Note on JSON. The default encoding will be url form encoded. If you want the request to send the data as JSON, you will need to add.. content-type: "application/json; charset=utf-8", also if you are returning JSON, you should add ... datatype : "json", Not sure which scripting language your...

jQuery DatePicker in combination with fullcalendar and jQuery dialog, mindate not working

jquery,jquery-ui,datepicker,fullcalendar

Appearantly you can't set your mindate with a dynamic value because the datepicker is only created once, what you have to do is set it using options every time the value changes like this: $("#enddate").datepicker('option', 'minDate', $mindate); I guess this technically solves my question but it shows the wrong date...

jquery breaking another javascript

javascript,jquery,html,jquery-ui,datepicker

add noConflict on very first line of your jquery script var $ = jQuery.noConflict(); $(document).ready(function () { $("#vodn").trigger("click"); $('#div1').hide('fast'); $('#vod').click(function () { $('#div2').hide('fast'); $('#div1').show('fast'); }); $('#vodn').click(function () { $('#div1').hide('fast'); $('#div2').show('fast'); }); }); ...

Kendo Date to Date Time

html,css,angularjs,kendo-ui,datepicker

You need to specify kendo date time picker parse-format and match it with kendo date picker format by default its follow your culture setting, e.g M/d/yyyy for en-US <input kendo-date-time-picker ng-model="dateString" k-ng-model="dateObject" k-parse-formats="['dd/MM/yyyy']" ng-show="!allDay"/> <input kendo-date-picker id="start-date" name="start-date" k-format="dd/MM/yyyy" ng-model="dateString" ng-show="allDay"> See my dojo...

Convert JSON.NET date to jQuery UI Datepicker format

jquery,jquery-ui,datepicker,momentjs

Using the moment.js library for formatting date, substitute moment(BoardStart).format('MM/DD/YYYY') with moment(BoardStart, "YYYY-MM-DDhh:mm:ss").format("MM/DD/YYYY") ...

How to achieve multiple datepicker functionality with two buttons and save those dates that are picked?

java,android,android-activity,datepicker

I have created DatePickerFragment helper class, With this you can select any number of date with just single DatePickerFragment class. public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener { /** * The callback interface used to indicate the user is done filling in the date (they clicked on the 'Set' button)....

Showing month and year in jquery datepicker

jquery,asp.net,datepicker

From the JQuery UI documentation: http://api.jqueryui.com/datepicker/#option-yearRange add yearRange: "min:max" to your datepicker....

Setting dateFormat of jquery ui datepicker restricts free text in input

jquery,jquery-ui,datepicker

I found an answer. There is a "constrainInput" option that must be set to false. So: $("#datepicker").datepicker({ dateFormat: "dd/mm/yy", constrainInput: false }); ...

How to get accurate age(including year and months) from current date?

android,methods,datepicker,monthcalendar

Use Joda time.It is best to calculate date differences.Download joda-time.jar and paste it in libs. Then use the following code: public static String getTimestampDiff() { final DateTime start = new DateTime(datefrom.getTime()); final DateTime end = new DateTime(dateto.getTime()); Period p = new Period(start, end); PeriodFormatter formatter = new PeriodFormatterBuilder() .printZeroAlways().minimumPrintedDigits(2).appendYears() .appendSuffix("...

Hide Calendar Button on DatePicker?

javafx,datepicker

You can use the following css to remove the calendar button .date-picker > .arrow-button { -fx-padding: 0px; } .date-picker > .arrow-button > .arrow { -fx-padding: 0px; } Edit - To get back the right border : .date-picker > .date-picker-display-node { -fx-background-insets: 1 1 1 1; } Edit - To apply...

How to enter value of datepicker into text field

javascript,jquery,ruby-on-rails,ruby,datepicker

This is a JQuery problem with using datepicker on multiple fields. It's not Rails's fault... I think the answer you need is "Apply jQuery datepicker to multiple instances": attach a unique id to each field, then script the function as below: HTML: <input type="text" class="datepick" id="date_1" /> <input type="text" class="datepick"...

Disable past dates and enable only certain future dates in datepicker

javascript,jquery,datepicker,mindate

You can add more options to the datepicker by separating them by commas. $(document).ready(function() { $('#input_40_4').datepicker({ beforeShowDay: function(date) { return [date.getDay() == 4, ""];}, minDate : 0 // you can add more options here as well, just seperate them by commas }); }); The reason why they didn't work in...

HTML date picker view

javascript,html,css,html5,datepicker

You are pretty limited in terms of style customization because the HTML5 date input UI is pulled from the OS of the device being used, rather than being rendered in the browser. From this site: You cannot currently style the appearance of the date picker. In WebKit, we have previously...

jquery datetime picker not working

jquery,datepicker

I found my fault! I manually added "hasDatepicker" class to input and this prevented jquery to show date picker.