Guest User

Untitled

a guest
Jan 16th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.45 KB | None | 0 0
  1. <script type='text/javascript'>/*<![CDATA[*/
  2. function date_picker_options(){
  3. return {
  4. buttonText: '<:afficher_calendrier|texte_script:>',
  5. buttonImage: '#CHEMIN_IMAGE{calendrier-16.png}',
  6. buttonImageOnly: true,
  7. closeText: '<:bouton_fermer|texte_script:>',
  8. prevText: '<:precedent|texte_script:>',
  9. nextText: '<:suivant|texte_script:>',
  10. currentText: '<:date_aujourdhui|texte_script:>',
  11. closeText: '<:bouton_fermer|texte_script:>',
  12. monthNames: [
  13. '<: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:>',
  14. '<: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:>'],
  15. monthNamesShort: [
  16. '<: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:>',
  17. '<: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:>'],
  18. dayNames: [
  19. '<:date_jour_1|texte_script:>','<:date_jour_2|texte_script:>','<:date_jour_3|texte_script:>','<:date_jour_4|texte_script:>',
  20. '<:date_jour_5|texte_script:>','<:date_jour_6|texte_script:>','<:date_jour_7|texte_script:>'],
  21. dayNamesShort: [
  22. '<:date_jour_1_abbr|texte_script:>','<:date_jour_2_abbr|texte_script:>','<:date_jour_3_abbr|texte_script:>','<:date_jour_4_abbr|texte_script:>',
  23. '<:date_jour_5_abbr|texte_script:>','<:date_jour_6_abbr|texte_script:>','<:date_jour_7_abbr|texte_script:>'],
  24. dayNamesMin: [
  25. '<:date_jour_1_initiale|texte_script:>','<:date_jour_2_initiale|texte_script:>','<:date_jour_3_initiale|texte_script:>','<:date_jour_4_initiale|texte_script:>',
  26. '<:date_jour_5_initiale|texte_script:>','<:date_jour_6_initiale|texte_script:>','<:date_jour_7_initiale|texte_script:>'],
  27. dateFormat: 'dd/mm/yy',
  28. firstDay: 1,
  29. changeMonth: true,
  30. changeYear: true,
  31. showOtherMonths: true,
  32. selectOtherMonths: true,
  33. yearRange: "c-60:c+40",
  34. beforeShowDay: nationalDays
  35. };
  36. }
  37.  
  38.  
  39. function date_picker_init(){
  40. jQuery('input.date').not('.datePicker')
  41. .addClass('datePicker').each(function(){
  42. var options = {showOn: 'button'};
  43. if (jQuery(this).attr('data-startDate'))
  44. options.minDate = jQuery(this).attr('data-startDate');
  45.  
  46. if (jQuery(this).attr('data-endDate'))
  47. options.maxDate = jQuery(this).attr('data-endDate');
  48. if (jQuery(this).attr('data-yearRange'))
  49. options.yearRange = jQuery(this).attr('data-yearRange');
  50. jQuery(this)
  51. .datepicker(jQuery.extend(date_picker_options(),options))
  52. .trigger('datePickerLoaded');
  53. });
  54. jQuery("input.heure").not('.timePicker').addClass('timePicker').timePicker({step:#ENV{heure_pas,30}});
  55. }
  56.  
  57. natDays = [
  58. [1, 26, 'au'],
  59. [2, 6, 'nz'],
  60. [3, 17, 'ie'],
  61. [4, 27, 'za'], [5, 25, 'ar'], [6, 6, 'se'],
  62. [7, 4, 'us'], [8, 17, 'id'], [9, 7, 'br'],
  63. [10, 1, 'cn'], [11, 22, 'lb'], [12, 12, 'ke']
  64. ];
  65.  
  66. function nationalDays(date) {
  67. for (i = 0; i < natDays.length; i++) {
  68. if (date.getMonth() == natDays[i][0] - 1
  69. && date.getDate() == natDays[i][1]) {
  70. return [false, natDays[i][2] + '_day'];
  71. }
  72. }
  73. return [true, ''];
  74. }
  75.  
  76. function noWeekendsOrHolidays(date) {
  77. var noWeekend = $.datepicker.noWeekends(date);
  78. if (noWeekend[0]) {
  79. return nationalDays(date);
  80. } else {
  81. return noWeekend;
  82. }
  83. }
  84.  
  85. var date_picker_loading;
  86. if (window.jQuery){
  87. jQuery(function(){
  88. if (jQuery('input.date,input.heure').length
  89. && typeof date_picker_loading=="undefined"){
  90. date_picker_loading = jQuery.getScript('[(#PRODUIRE{fond=formulaires/dateur/jquery.dateur.js}|timestamp)]');
  91. date_picker_loading.done(function(){
  92. date_picker_init();
  93. onAjaxLoad(date_picker_init);
  94. })
  95. }
  96. });
  97. }
  98. /*]]>*/</script>
  99. <style type="text/css">
  100. [(#INCLURE{formulaires/dateur/time_picker.css}|compacte{css})]
  101. img.ui-datepicker-trigger { display: inline-block; padding: 0; margin: 0; margin-[(#ENV{lang}|lang_dir|choixsiegal{ltr,left,right})]: -19px; vertical-align: middle; z-index:2 }
  102. div.time-picker {font-size:11px; width:5em; /* needed for IE */}
  103. .formulaire_spip input.date {width:9em;padding-[(#ENV{lang}|lang_dir|choixsiegal{ltr,right,left})]:25px;}
  104. .formulaire_spip input.heure {width:7em;}
  105. </style>
Add Comment
Please, Sign In to add comment