Ci-dessous, les différences entre deux révisions de la page.
devweb:jquery:datepicker [10-03-2014 09:32] edmc73 créée |
devweb:jquery:datepicker [17-02-2016 17:29] (Version actuelle) edmc73 |
||
---|---|---|---|
Ligne 2: | Ligne 2: | ||
+ | ====== Installation ====== | ||
+ | |||
+ | Utiliser jqueryUI et le fichier jquery.ui.datepicker-fr.js pour avoir les dates en français | ||
+ | |||
+ | <file javascript jquery.ui.datepicker-fr.js> | ||
+ | /* French initialisation for the jQuery UI date picker plugin. */ | ||
+ | /* Written by Keith Wood (kbwood{at}iinet.com.au), | ||
+ | Stéphane Nahmani (sholby@sholby.net), | ||
+ | Stéphane Raimbault < | ||
+ | jQuery(function($){ | ||
+ | $.datepicker.regional[' | ||
+ | closeText: | ||
+ | prevText: ' | ||
+ | nextText: ' | ||
+ | currentText: | ||
+ | monthNames: | ||
+ | ' | ||
+ | monthNamesShort: | ||
+ | ' | ||
+ | dayNames: [' | ||
+ | dayNamesShort: | ||
+ | dayNamesMin: | ||
+ | weekHeader: | ||
+ | dateFormat: | ||
+ | firstDay: 1, | ||
+ | isRTL: false, | ||
+ | showMonthAfterYear: | ||
+ | yearSuffix: | ||
+ | $.datepicker.setDefaults($.datepicker.regional[' | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | Ensuite mettez un champ texte | ||
+ | <code html> | ||
+ | <input type=" | ||
+ | </ | ||
+ | Et le code jquery qui va bien | ||
+ | <code javascript> | ||
+ | $( "# | ||
+ | dateFormat: " | ||
+ | changeMonth: | ||
+ | changeYear: true, | ||
+ | showOtherMonths: | ||
+ | selectOtherMonths: | ||
+ | onSelect: function(date){ | ||
+ | location.href='? | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | </ | ||
+ | Dans cet exemple, on change de page lorsque l'on sélectionne une date en passant la valeur de date dans l'url | ||
===== exemple pour gérer des dates ===== | ===== exemple pour gérer des dates ===== |