1 | /*
|
---|
2 | %e Day of the month without leading zeros (01..31)
|
---|
3 | %d Day of the month, 2 digits with leading zeros (01..31)
|
---|
4 | %j Day of the year, 3 digits with leading zeros (001..366)
|
---|
5 | %a A textual representation of a day, two letters
|
---|
6 | %W A full textual representation of the day of the week
|
---|
7 |
|
---|
8 | %c Numeric representation of a month, without leading zeros (0..12)
|
---|
9 | %m Numeric representation of a month, with leading zeros (00..12)
|
---|
10 | %b A short textual representation of a month, three letters (Jan..Dec)
|
---|
11 | %M A full textual representation of a month, such as January or March (January..December)
|
---|
12 |
|
---|
13 | %y A two digit representation of a year (93..03)
|
---|
14 | %Y A full numeric representation of a year, 4 digits (1993..03)
|
---|
15 | */
|
---|
16 |
|
---|
17 | scheduler.config={
|
---|
18 | default_date: "%j %M %Y",
|
---|
19 | month_date: "%F %Y",
|
---|
20 | load_date: "%Y-%m-%d",
|
---|
21 | week_date: "%l",
|
---|
22 | day_date: "%D, %F %j",
|
---|
23 | hour_date: "%H:%i",
|
---|
24 | month_day : "%d",
|
---|
25 | xml_date:"%m/%d/%Y %H:%i",
|
---|
26 | api_date:"%d-%m-%Y %H:%i",
|
---|
27 |
|
---|
28 | hour_size_px:42,
|
---|
29 | time_step:5,
|
---|
30 |
|
---|
31 | start_on_monday:1,
|
---|
32 | first_hour:0,
|
---|
33 | last_hour:24,
|
---|
34 | readonly:false,
|
---|
35 | drag_resize:1,
|
---|
36 | drag_move:1,
|
---|
37 | drag_create:1,
|
---|
38 | dblclick_create:1,
|
---|
39 | edit_on_create:1,
|
---|
40 | details_on_create:0,
|
---|
41 | click_form_details:0,
|
---|
42 |
|
---|
43 | server_utc:false,
|
---|
44 |
|
---|
45 | positive_closing:false,
|
---|
46 |
|
---|
47 | icons_edit:["icon_save","icon_cancel"],
|
---|
48 | icons_select:["icon_details","icon_edit","icon_delete"],
|
---|
49 |
|
---|
50 | lightbox:{
|
---|
51 | sections:[ {name:"description", height:200, map_to:"text", type:"textarea" , focus:true},
|
---|
52 | {name:"time", height:72, type:"time", map_to:"auto"} ]
|
---|
53 | }
|
---|
54 | };
|
---|
55 | scheduler.templates={}
|
---|
56 | scheduler.init_templates=function(){
|
---|
57 | var d=scheduler.date.date_to_str;
|
---|
58 | var c=scheduler.config;
|
---|
59 | var f = function(a,b){
|
---|
60 | for (var c in b)
|
---|
61 | if (!a[c]) a[c]=b[c];
|
---|
62 | }
|
---|
63 | f(scheduler.templates,{
|
---|
64 | day_date:d(c.default_date),
|
---|
65 | month_date:d(c.month_date),
|
---|
66 | week_date:function(d1,d2){
|
---|
67 | return scheduler.templates.day_date(d1)+" – "+scheduler.templates.day_date(scheduler.date.add(d2,-1,"day"));
|
---|
68 | },
|
---|
69 | day_scale_date:d(c.default_date),
|
---|
70 | month_scale_date:d(c.week_date),
|
---|
71 | week_scale_date:d(c.day_date),
|
---|
72 | hour_scale:d(c.hour_date),
|
---|
73 | time_picker:d(c.hour_date),
|
---|
74 | event_date:d(c.hour_date),
|
---|
75 | month_day:d(c.month_day),
|
---|
76 | xml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),
|
---|
77 | load_format:d(c.load_date,c.server_utc),
|
---|
78 | xml_format:d(c.xml_date,c.server_utc),
|
---|
79 | api_date:scheduler.date.str_to_date(c.api_date),
|
---|
80 | event_header:function(start,end,ev){
|
---|
81 | return scheduler.templates.event_date(start)+" - "+scheduler.templates.event_date(end);
|
---|
82 | },
|
---|
83 | event_text:function(start,end,ev){
|
---|
84 | return ev.text;
|
---|
85 | },
|
---|
86 | event_class:function(start,end,ev){
|
---|
87 | return "";
|
---|
88 | },
|
---|
89 | month_date_class:function(d){
|
---|
90 | return "";
|
---|
91 | },
|
---|
92 | week_date_class:function(d){
|
---|
93 | return "";
|
---|
94 | },
|
---|
95 | event_bar_date:function(start,end,ev){
|
---|
96 | return scheduler.templates.event_date(start)+" ";
|
---|
97 | },
|
---|
98 | event_bar_text:function(start,end,ev){
|
---|
99 | return ev.text;
|
---|
100 | }
|
---|
101 | });
|
---|
102 | this.callEvent("onTemplatesReady",[])
|
---|
103 | }
|
---|
104 |
|
---|
105 |
|
---|