I work with this excellent plugin, as I can do to make the change event work on the currently selected day , this is the code
$('#id_fecha').on("dp.change", function(e){alert('ok');}
this not work for the active day, thanks.
without seeing your implementation, the most obvious thing is there is an error in your code:
you are missing a ) at the end:
$('#id_fecha').on("dp.change", function(e){alert('ok');});
Related
I was thinking of having some double arrows that allow year scrolling similar to the month scrolling ones. Other ideas on how to reach the main goals are more than welcome.
GitHub link:
https://github.com/Hacker0x01/react-datepicker
You can look this example. You need to pass showMonthDropdown and showYearDropdown for the DatePicker to display select dropdowns for year and month.
do you want something like this.
just add this code to your react calendar :
dateFormatCalendar="YYYY"
I am using demo sample located https://jsfiddle.net/OlegKi/90qmjean/3/
Some reason datepicker is not rendering? also i need to set dateformat to
ISO8601Long:"Y-m-d H:i:s"
But with original date formatter shows selected date as 'Y-3-14 H:i:s'
see the screenshot for details:enter image description here
The problem, which you described in comments above, is the following: you are wonder why the Bootstrap datetimepicker, used in the demo http://jsfiddle.net/OlegKi/duooa5oy/1/, don't close the calendar window after choosing the date.
First of all, I want to stress, that it's the default behavior of the Bootstrap datetime picker. You can try any demo on the page http://eonasdan.github.io/bootstrap-datetimepicker/ to verify that. The reason of the behavior is easy to understand. The datetimepicker allows to change the time and not only the date. The corresponding control contains 4 buttons, which increase/decrease the time via click on the buttons. I marked the buttons on the picture below:
Thus, what you probably want is closing of the datetimepicker if the date (and not the time) is changed. One can implement the requirements by adding the following lines in the demo:
$(el).bind("dp.change", function (e) {
if (e.date.dayOfYear() !== e.oldDate.dayOfYear()) {
$(this).data("DateTimePicker").hide();
}
});
See the modified date http://jsfiddle.net/OlegKi/duooa5oy/7/
It looks like when i updated boostrap-datepicker to latest version, it worked.
I have a problem with a bootstrap datepicker. Here is a Plunker example.
This one is not from me. To get it working, you have to change line 60 into:
else if (attrs.initDate)
Just delete the exclamation mark.
Now you get the init-date in the 2nd input-field.
My Problem:
If you click in the 2nd input-field and click somewhere in the document without selecting a date, it changes the init-date into todays date. I want to keep the init date, dough.
Does anyone have a solution for it?
you can look at the documentation here:
http://bootstrap-datepicker.readthedocs.org/en/latest/options.html#forceparse
look at the forceParse, you need to set it to false.
so just add:
$(element).datepicker({
format: format,
forceParse: false
I am using jquery-1.11.0 and jquery-ui datepicker to achieve a dropdown datepick on my textfield.
However, for Thailand, there is something call the Buddhist year which adds 543 to our current phyiscal year. How can I achieve this with the jquery datepicker? I have tried the follow sites but due to different jquery version, it seems to have a weird behaviour.
https://code.google.com/p/jquery-ui-datepicker-extension-buddhist-era/
http://www.anassirk.com/articles/1
http://keith-wood.name/calendarsPickerRef.html
What you describe is fairly trivial with leveraging the datepicker's yearSuffix option, which allows you to insert unescaped html. Something like:
In stylesheet:
.ui-datepicker-year { display:none; }
In onChangeMonthYear:
inst.settings.yearSuffix = year + 543;
See jsfiddle here
Disclaimer: At some point someone will probably realize what a terrible idea it is to append unescaped html to your widget's titlebar, and this will become unusable. Should be fine for 1.11.0/1.10.4.
Disclaimer2: I know absolutely nothing about Buddhist years. This simply changes the visible year to year+543. It handles absolutely no corner cases
I dont want to use HTML drop down for AM PM time picker in 12 hours format...can any one give me LInk regarding this.I want Jquery/Javascript/CSS based AM PM picker
Here is a solution that does what you want, though tbthorpe is right, it might be good to make the two spans I use into radio buttons, and style those so they work the same as my solution.
http://jsfiddle.net/csaltyj/PPQQ8/
What you could do is, have radio buttons with a class on it, and use jQuery to hide those and replace them with the clickable spans which actually trigger the radio button clicks. Probably a better solution for accessibility.
Here's a more robust time picker than just AM/PM - it's a jQuery plugin. Presumably, you could pare down the js/css and have it just let you pick am or pm.
http://fgelinas.com/code/timepicker/
I found this trying to find a decent time picker which supports US AM/PM style and doesn't use a drop down. The best tool for me was anytime. http://www.ama3.com/anytime/
example code (assuming you have loaded jQuery and the AnyTime script)
$("#field2").AnyTime_picker( {
format: "%h:%i %p",
labelTitle: "Time",
labelHour: "Hour",
labelMinute: "Minute"
} );
supporting html
<input type="text" id="field2" value="" readonly="">
Example fiddle:
http://jsfiddle.net/brianlmerritt/Lzn7fnnw/2/
And it looks like this...