Commit a95b6da5 authored by Gabriel Monnerat's avatar Gabriel Monnerat

refactor code to display the current date of calendar

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42985 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e012dc33
...@@ -69,6 +69,15 @@ ...@@ -69,6 +69,15 @@
</span>\n </span>\n
</div>\n </div>\n
</div>\n </div>\n
<div id="sfprevbtn" title="Prev" class="fbutton">\n
<span class="fprev"></span>\n
</div>\n
<div id="sfnextbtn" title="Next" class="fbutton">\n
<span class="fnext"></span>\n
</div>\n
<div id="display-datetime" class="fbutton">\n
<span id="text-datetime"> </span>\n
</div>\n
<div id="showdaybtn" class="fbutton">\n <div id="showdaybtn" class="fbutton">\n
<div>\n <div>\n
<span title=\'Day\' class="showdayview">\n <span title=\'Day\' class="showdayview">\n
...@@ -97,13 +106,6 @@ ...@@ -97,13 +106,6 @@
</span>\n </span>\n
</div>\n </div>\n
</div>\n </div>\n
<div id="sfprevbtn" title="Prev" class="fbutton">\n
<span class="fprev"></span>\n
</div>\n
<div id="sfnextbtn" title="Next" class="fbutton">\n
<span class="fnext"></span>\n
</div>\n
<div class="clear"></div>\n
</div>\n </div>\n
</div>\n </div>\n
<div style="padding:1px;">\n <div style="padding:1px;">\n
......
...@@ -229,6 +229,10 @@ div#showreflashbtn.fbutton,\n ...@@ -229,6 +229,10 @@ div#showreflashbtn.fbutton,\n
div#showmonthbtn.fbutton,\n div#showmonthbtn.fbutton,\n
div#showweekbtn.fbutton {\n div#showweekbtn.fbutton {\n
float: right !important;\n float: right !important;\n
}\n
\n
span#text-datetime {\n
margin-top: 4px;\n
}</string> </value> }</string> </value>
</item> </item>
<item> <item>
......
...@@ -183,7 +183,8 @@ $(document).ready(function() { \n ...@@ -183,7 +183,8 @@ $(document).ready(function() { \n
$(this).removeClass("fcurrent");\n $(this).removeClass("fcurrent");\n
})\n })\n
$(this).addClass("fcurrent");\n $(this).addClass("fcurrent");\n
$("#gridcontainer").swtichView("day").BcalGetOp();\n var optionList = $("#gridcontainer").swtichView("day").BcalGetOp();\n
$("div#display-datetime span#text-datetime").text(optionList.datestrshow);\n
});\n });\n
//to show week view\n //to show week view\n
$("#showweekbtn").click(function(e) {\n $("#showweekbtn").click(function(e) {\n
...@@ -191,7 +192,8 @@ $(document).ready(function() { \n ...@@ -191,7 +192,8 @@ $(document).ready(function() { \n
$(this).removeClass("fcurrent");\n $(this).removeClass("fcurrent");\n
})\n })\n
$(this).addClass("fcurrent");\n $(this).addClass("fcurrent");\n
$("#gridcontainer").swtichView("week").BcalGetOp();\n var optionList = $("#gridcontainer").swtichView("week").BcalGetOp();\n
$("div#display-datetime span#text-datetime").text(optionList.datestrshow);\n
});\n });\n
//to show month view\n //to show month view\n
$("#showmonthbtn").click(function(e) {\n $("#showmonthbtn").click(function(e) {\n
...@@ -200,7 +202,8 @@ $(document).ready(function() { \n ...@@ -200,7 +202,8 @@ $(document).ready(function() { \n
$(this).removeClass("fcurrent");\n $(this).removeClass("fcurrent");\n
})\n })\n
$(this).addClass("fcurrent");\n $(this).addClass("fcurrent");\n
$("#gridcontainer").swtichView("month").BcalGetOp();\n var optionList = $("#gridcontainer").swtichView("month").BcalGetOp();\n
$("div#display-datetime span#text-datetime").text(optionList.datestrshow);\n
});\n });\n
$("#showreflashbtn").click(function(e){\n $("#showreflashbtn").click(function(e){\n
$("#gridcontainer").reload();\n $("#gridcontainer").reload();\n
...@@ -232,15 +235,18 @@ $(document).ready(function() { \n ...@@ -232,15 +235,18 @@ $(document).ready(function() { \n
});\n });\n
//go to today\n //go to today\n
$("#showtodaybtn").click(function() {\n $("#showtodaybtn").click(function() {\n
$("#gridcontainer").gotoDate().BcalGetOp();\n var optionList = $("#gridcontainer").gotoDate().BcalGetOp();\n
$("div#display-datetime span#text-datetime").text(p.datestrshow);\n
});\n });\n
//previous date range\n //previous date range\n
$("#sfprevbtn").click(function() {\n $("#sfprevbtn").click(function() {\n
$("#gridcontainer").previousRange().BcalGetOp();\n var optionList = $("#gridcontainer").previousRange().BcalGetOp();\n
$("div#display-datetime span#text-datetime").text(optionList.datestrshow);\n
});\n });\n
//next date range\n //next date range\n
$("#sfnextbtn").click(function() {\n $("#sfnextbtn").click(function() {\n
$("#gridcontainer").nextRange().BcalGetOp();\n var optionList = $("#gridcontainer").nextRange().BcalGetOp();\n
$("div#display-datetime span#text-datetime").text(optionList.datestrshow);\n
});\n });\n
$("div#new_event_dialog").dialog({\n $("div#new_event_dialog").dialog({\n
autoOpen: false,\n autoOpen: false,\n
...@@ -254,7 +260,8 @@ $(document).ready(function() { \n ...@@ -254,7 +260,8 @@ $(document).ready(function() { \n
var month = dateList[0] - 1;\n var month = dateList[0] - 1;\n
var day = dateList[1];\n var day = dateList[1];\n
var year = dateList[2];\n var year = dateList[2];\n
$("#gridcontainer").gotoDate(new Date(year, month, day)).BcalGetOp();\n var optionList = $("#gridcontainer").gotoDate(new Date(year, month, day)).BcalGetOp();\n
$("div#display-datetime span#text-datetime").text(optionList.datestrshow);\n
}\n }\n
});\n });\n
$("input#submit-search").click(function(event){\n $("input#submit-search").click(function(event){\n
......
221 222
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment