mirror of
https://github.com/YunoHost-Apps/spip_ynh.git
synced 2024-09-03 20:25:59 +02:00
73 lines
3.7 KiB
HTML
73 lines
3.7 KiB
HTML
<script type='text/javascript'>/*<![CDATA[*/
|
|
function date_picker_options(){
|
|
return {
|
|
buttonText: '<:afficher_calendrier|texte_script:>',
|
|
buttonImage: '#CHEMIN_IMAGE{calendrier-16.png}',
|
|
buttonImageOnly: true,
|
|
closeText: '<:bouton_fermer|texte_script:>',
|
|
prevText: '<:precedent|texte_script:>',
|
|
nextText: '<:suivant|texte_script:>',
|
|
currentText: '<:date_aujourdhui|texte_script:>',
|
|
closeText: '<:bouton_fermer|texte_script:>',
|
|
monthNames: [
|
|
'<:date_mois_1|texte_script:>','<:date_mois_2|texte_script:>','<:date_mois_3|texte_script:>','<:date_mois_4|texte_script:>','<:date_mois_5|texte_script:>','<:date_mois_6|texte_script:>',
|
|
'<:date_mois_7|texte_script:>','<:date_mois_8|texte_script:>','<:date_mois_9|texte_script:>','<:date_mois_10|texte_script:>','<:date_mois_11|texte_script:>','<:date_mois_12|texte_script:>'],
|
|
monthNamesShort: [
|
|
'<:date_mois_1_abbr|texte_script:>','<:date_mois_2_abbr|texte_script:>','<:date_mois_3_abbr|texte_script:>','<:date_mois_4_abbr|texte_script:>','<:date_mois_5_abbr|texte_script:>','<:date_mois_6_abbr|texte_script:>',
|
|
'<:date_mois_7_abbr|texte_script:>','<:date_mois_8_abbr|texte_script:>','<:date_mois_9_abbr|texte_script:>','<:date_mois_10_abbr|texte_script:>','<:date_mois_11_abbr|texte_script:>','<:date_mois_12_abbr|texte_script:>'],
|
|
dayNames: [
|
|
'<:date_jour_1|texte_script:>','<:date_jour_2|texte_script:>','<:date_jour_3|texte_script:>','<:date_jour_4|texte_script:>',
|
|
'<:date_jour_5|texte_script:>','<:date_jour_6|texte_script:>','<:date_jour_7|texte_script:>'],
|
|
dayNamesShort: [
|
|
'<:date_jour_1_abbr|texte_script:>','<:date_jour_2_abbr|texte_script:>','<:date_jour_3_abbr|texte_script:>','<:date_jour_4_abbr|texte_script:>',
|
|
'<:date_jour_5_abbr|texte_script:>','<:date_jour_6_abbr|texte_script:>','<:date_jour_7_abbr|texte_script:>'],
|
|
dayNamesMin: [
|
|
'<:date_jour_1_initiale|texte_script:>','<:date_jour_2_initiale|texte_script:>','<:date_jour_3_initiale|texte_script:>','<:date_jour_4_initiale|texte_script:>',
|
|
'<:date_jour_5_initiale|texte_script:>','<:date_jour_6_initiale|texte_script:>','<:date_jour_7_initiale|texte_script:>'],
|
|
dateFormat: 'dd/mm/yy',
|
|
firstDay: 1,
|
|
isRTL: [(#ENV{lang}|lang_dir|=={rtl}|?{true,false})],
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
showOtherMonths: true,
|
|
selectOtherMonths: true,
|
|
yearRange: "c-60:c+40"
|
|
};
|
|
}
|
|
function date_picker_init(){
|
|
jQuery('input.date').not('.datePicker')
|
|
.addClass('datePicker').each(function(){
|
|
var options = {showOn: 'button'};
|
|
if (jQuery(this).attr('data-startDate'))
|
|
options.minDate = jQuery(this).attr('data-startDate');
|
|
if (jQuery(this).attr('data-endDate'))
|
|
options.maxDate = jQuery(this).attr('data-endDate');
|
|
if (jQuery(this).attr('data-yearRange'))
|
|
options.yearRange = jQuery(this).attr('data-yearRange');
|
|
jQuery(this)
|
|
.datepicker(jQuery.extend(date_picker_options(),options))
|
|
.trigger('datePickerLoaded');
|
|
});
|
|
jQuery("input.heure").not('.timePicker').addClass('timePicker').timePicker({step:#ENV{heure_pas,30}});
|
|
}
|
|
var date_picker_loading;
|
|
if (window.jQuery){
|
|
jQuery(function(){
|
|
if (jQuery('input.date,input.heure').length
|
|
&& typeof date_picker_loading=="undefined"){
|
|
date_picker_loading = jQuery.getScript('#PRODUIRE{fond=formulaires/dateur/jquery.dateur.js}');
|
|
date_picker_loading.done(function(){
|
|
date_picker_init();
|
|
onAjaxLoad(date_picker_init);
|
|
})
|
|
}
|
|
});
|
|
}
|
|
/*]]>*/</script>
|
|
<style type="text/css">
|
|
[(#INCLURE{formulaires/dateur/time_picker.css}|compacte{css})]
|
|
img.ui-datepicker-trigger { display: inline-block; padding: 0; margin: 0px 0 0 -19px; vertical-align: middle; }
|
|
div.time-picker {font-size:11px; width:5em; /* needed for IE */}
|
|
.formulaire_spip input.date {width:9em;padding-right:25px;}
|
|
.formulaire_spip input.heure {width:7em;}
|
|
</style>
|