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($){ |