View | Details | Raw Unified | Return to bug 8428
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc (+21 lines)
Lines 1-5 Link Here
1
<script type="text/javascript">
1
<script type="text/javascript">
2
//<![CDATA[
2
//<![CDATA[
3
4
var debug    = "[% debug %]";
5
var dformat  = "[% dateformat %]";
6
var sentmsg = 0;
7
if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");}
8
9
function Date_from_syspref(dstring) {
10
        var dateX = dstring.split(/[-/]/);
11
        if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));}
12
        if (dformat === "iso") {
13
                return new Date(dateX[0], (dateX[1] - 1), dateX[2]);  // YYYY-MM-DD to (YYYY,m(0-11),d)
14
        } else if (dformat === "us") {
15
                return new Date(dateX[2], (dateX[0] - 1), dateX[1]);  // MM/DD/YYYY to (YYYY,m(0-11),d)
16
        } else if (dformat === "metric") {
17
                return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD/MM/YYYY to (YYYY,m(0-11),d)
18
        } else {
19
                if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);}
20
                return 0;
21
        }
22
}
23
3
/* Instead of including multiple localization files as you would normally see with
24
/* Instead of including multiple localization files as you would normally see with
4
   jQueryUI we expose the localization strings in the default configuration */
25
   jQueryUI we expose the localization strings in the default configuration */
5
jQuery(function($){
26
jQuery(function($){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt (-2 / +2 lines)
Lines 22-29 function Check(ff) { Link Here
22
        ok=1;
22
        ok=1;
23
        _alertString += _("- Name missing") + "\n";
23
        _alertString += _("- Name missing") + "\n";
24
    }
24
    }
25
    var startDate = Date_from_syspref($("#contractstartdate").val());
25
    var startDate = Date_from_syspref($("#from").val());
26
    var endDate   = Date_from_syspref($("#contractenddate").val());
26
    var endDate   = Date_from_syspref($("#to").val());
27
    if (!parseInt(startDate.getTime())) {
27
    if (!parseInt(startDate.getTime())) {
28
        ok=1;
28
        ok=1;
29
        _alertString += _("- Start date missing or invalid.") + "\n";
29
        _alertString += _("- Start date missing or invalid.") + "\n";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-3 / +2 lines)
Lines 92-99 Link Here
92
	}
92
	}
93
	// Filter by date
93
	// Filter by date
94
	function filterByDate() {
94
	function filterByDate() {
95
	    var beginDate = Date_from_syspref($("#begindate").val()).getTime();
95
        var beginDate = Date_from_syspref($("#from").val()).getTime();
96
	    var endDate   = Date_from_syspref($("#enddate").val()).getTime();
96
        var endDate   = Date_from_syspref($("#to").val()).getTime();
97
	    
97
	    
98
	    // Checks if the beginning date is valid
98
	    // Checks if the beginning date is valid
99
	    if (!parseInt(beginDate)) {
99
	    if (!parseInt(beginDate)) {
100
- 

Return to bug 8428