Merge remote branch 'kc/new/enh/bug_5917' into kcmaster
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / calendar.inc
1 <link rel="stylesheet" type="text/css" href="[% themelang %]/lib/calendar/calendar-system.css"/>
2 <script type="text/javascript" src="[% themelang %]/lib/calendar/calendar.js"></script>
3 <script type="text/javascript">
4 // full day names
5 Calendar._DN = new Array(_("Sunday"),_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday"),_("Sunday"));
6 // short day names
7 Calendar._SDN = new Array(_("Sun"),_("Mon"),_("Tue"),_("Wed"),_("Thu"),_("Fri"),_("Sat"),_("Sun"));
8 // First day of the week. "0" means display Sunday first, "1" means display
9 // Monday first, etc.
10 Calendar._FD = 1;
11 // full month names
12 Calendar._MN = new Array(_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December"));
13 // short month names
14 Calendar._SMN = new Array(_("Jan"),_("Feb"),_("Mar"),_("Apr"),_("May"),_("Jun"),_("Jul"),_("Aug"),_("Sep"),_("Oct"),_("Nov"),_("Dec"));
15 // tooltips
16 Calendar._TT = {};
17 Calendar._TT["INFO"] = _("About the calendar");
18
19 Calendar._TT["ABOUT"] =
20 _("Dhtml Date/Time Selector")+"\n" +
21 "(c) dynarch.com 2002-2003\n" + // don't translate this this ;-)
22 _("For latest version visit: http://dynarch.com/mishoo/calendar.epl")+"\n" +
23 _("Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details.") +
24 "\n\n" +
25 _("Date selection:")+"\n" +
26 _("- Use the \xab, \xbb buttons to select year")+"\n" +
27 _("- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month")+"\n" +
28 _("- Hold mouse button on any of the above buttons for faster selection.");
29 Calendar._TT["ABOUT_TIME"] = "\n\n" +
30 _("Time selection:")+"\n" +
31 _("- Click on any of the time parts to increase it")+"\n" +
32 _("- or Shift-click to decrease it")+"\n" +
33 _("- or click and drag for faster selection.");
34
35 Calendar._TT["PREV_YEAR"] = _("Prev. year (hold for menu)");
36 Calendar._TT["PREV_MONTH"] = _("Prev. month (hold for menu)");
37 Calendar._TT["GO_TODAY"] = _("Go to Today");
38 Calendar._TT["NEXT_MONTH"] = _("Next month (hold for menu)");
39 Calendar._TT["NEXT_YEAR"] = _("Next year (hold for menu)");
40 Calendar._TT["SEL_DATE"] = _("Select date");
41 Calendar._TT["DRAG_TO_MOVE"] = _("Drag to move");
42 Calendar._TT["PART_TODAY"] = _(" (today)");
43
44 // the following is to inform that "%s" is to be the first day of week
45 // %s will be replaced with the day name.
46 Calendar._TT["DAY_FIRST"] = _("Display %s first");
47
48 // This may be locale-dependent.  It specifies the week-end days, as an array
49 // of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
50 // means Monday, etc.
51 Calendar._TT["WEEKEND"] = "0,6";
52
53 Calendar._TT["CLOSE"] = _("Close");
54 Calendar._TT["TODAY"] = _("Today");
55 Calendar._TT["TIME_PART"] = _("(Shift-)Click or drag to change value");
56
57 // date formats
58 Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
59 Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
60
61 Calendar._TT["WK"] = _("wk");
62 Calendar._TT["TIME"] = _("Time:");
63 </script>
64 <script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-setup.js"></script>
65 <script type="text/javascript">
66 //<![CDATA[
67 var debug    = "[% debug %]";
68 var dformat  = "[% dateformat %]";
69 var sentmsg = 0;
70 if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");}
71
72 function Date_from_syspref(dstring) {
73         var dateX = dstring.split(/[-/]/);
74         if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));}
75         if (dformat === "iso") {
76                 return new Date(dateX[0], (dateX[1] - 1), dateX[2]);  // YYYY-MM-DD to (YYYY,m(0-11),d)
77         } else if (dformat === "us") {
78                 return new Date(dateX[2], (dateX[0] - 1), dateX[1]);  // MM/DD/YYYY to (YYYY,m(0-11),d)
79         } else if (dformat === "metric") {
80                 return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD/MM/YYYY to (YYYY,m(0-11),d)
81         } else {
82                 if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);}
83                 return 0;
84         }
85 }
86
87 function get_Calendar_limit (date,did) {
88         // this function could be moved to a static calendar-extras.js file
89         var dvalue = document.getElementById(did).value;
90         if (dvalue == "") { return false; }
91         var limitDate = Date_from_syspref(dvalue);
92         if (debug && debug > 5) {
93                 var month = date.getMonth() + 1;
94                 var dateString = date.getFullYear() + '-' + month + '-' + date.getDate();
95                 alert("Comparing incoming (" + dateString + ") vs "
96                         + "'" + did + "' limit\n"
97                         + "\n thisdate: " + date
98                         + "\nlimitdate: " + limitDate
99                         + "\nlimit > thisdate : " + (limitDate > date) 
100                         + "\nlimit < thisdate : " + (limitDate < date) 
101                 );
102         }
103         return limitDate;
104 }
105 //]]>
106 </script>