diff options
Diffstat (limited to 'admin/template')
-rw-r--r-- | admin/template/goto/include/datepicker.inc.tpl | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/admin/template/goto/include/datepicker.inc.tpl b/admin/template/goto/include/datepicker.inc.tpl index ebd6b0fea..360a2e0d7 100644 --- a/admin/template/goto/include/datepicker.inc.tpl +++ b/admin/template/goto/include/datepicker.inc.tpl @@ -1,5 +1,7 @@ {* $Id$ *} -{known_script id="jquery.ui.datepicker" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.datepicker.js"} +{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"} +{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"} +{known_script id="jquery.ui.datepicker" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.datepicker.packed.js"} {known_script id="jquery.ui.datepicker-$lang_info.code" src=$ROOT_URL|@cat:"template-common/lib/ui/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"} {html_head} @@ -30,18 +32,8 @@ function pwg_initialization_datepicker(day, month, year, linked_date, min_linked m = array_date[1]; d = array_date[2]; - var daysInMonth = 32 - new Date($(year).val(), $(month).val() - 1, 32).getDate(); - - $(day + " option").attr("disabled", ""); - $(day + " option:gt(" + (daysInMonth) +")").attr("disabled", "disabled"); - - if ($(day).val() > daysInMonth) { - $(day).val(daysInMonth); - } - $(linked_date).val(pwg_get_fmt_datepicker(day, month, year)); - cancel = false; if ((min_linked_date != null) && ($(min_linked_date).datepicker("getDate") != null)) { cancel = ($(min_linked_date).datepicker("getDate") > $(linked_date).datepicker("getDate")); @@ -50,7 +42,11 @@ function pwg_initialization_datepicker(day, month, year, linked_date, min_linked { cancel = ($(max_linked_date).datepicker("getDate") < $(linked_date).datepicker("getDate")); } - + else + { + cancel = false; + } + if (cancel) { $(year).val(y); @@ -59,6 +55,12 @@ function pwg_initialization_datepicker(day, month, year, linked_date, min_linked // check again pwg_check_date(); } + else + { + var daysInMonth = 32 - new Date($(year).val(), $(month).val() - 1, 32).getDate(); + $(day + " option").attr("disabled", ""); + $(day + " option:gt(" + (daysInMonth) +")").attr("disabled", "disabled"); + } } jQuery().ready(function(){ @@ -82,7 +84,6 @@ function pwg_initialization_datepicker(day, month, year, linked_date, min_linked } else { - console.log("none"); return {}; } }, @@ -117,6 +118,9 @@ function pwg_initialization_datepicker(day, month, year, linked_date, min_linked { pwg_check_date(); }); + + // In order to desable element of list + pwg_check_date(); }); } |