From f9813ca823e830cd8cdc712bec72a4f3062fefab Mon Sep 17 00:00:00 2001 From: naomiaro Date: Thu, 16 Dec 2010 00:47:32 -0500 Subject: [PATCH] maketimestamp function --- .../views/scripts/schedule/clear-show.phtml | 1 + public/js/campcaster/schedule/schedule.js | 38 ++++++++----------- 2 files changed, 17 insertions(+), 22 deletions(-) create mode 100644 application/views/scripts/schedule/clear-show.phtml diff --git a/application/views/scripts/schedule/clear-show.phtml b/application/views/scripts/schedule/clear-show.phtml new file mode 100644 index 000000000..839707d86 --- /dev/null +++ b/application/views/scripts/schedule/clear-show.phtml @@ -0,0 +1 @@ +

View script for controller Schedule and script/action name clearShow
\ No newline at end of file diff --git a/public/js/campcaster/schedule/schedule.js b/public/js/campcaster/schedule/schedule.js index 04d37df8f..12caef557 100644 --- a/public/js/campcaster/schedule/schedule.js +++ b/public/js/campcaster/schedule/schedule.js @@ -4,6 +4,19 @@ * */ +function makeTimeStamp(date){ + var sy, sm, sd, h, m, s, timestamp; + sy = date.getFullYear(); + sm = date.getMonth() + 1; + sd = date.getDate(); + h = date.getHours(); + m = date.getMinutes(); + s = date.getSeconds(); + + timestamp = sy+"-"+ sm +"-"+ sd +" "+ h +":"+ m +":"+ s; + return timestamp; +} + //dateText mm-dd-yy function startDpSelect(dateText, inst) { var time, date; @@ -100,18 +113,9 @@ function schedulePlaylist() { } pl_id = li.data('pl_id'); - event = li.parent().data('event'); - start = event.start; + event = li.parent().data('event'); - var sy, sm, sd, h, m, s; - sy = start.getFullYear(); - sm = start.getMonth() + 1; - sd = start.getDate(); - h = start.getHours(); - m = start.getMinutes(); - s = start.getSeconds(); - - start_date = sy+"-"+ sm +"-"+ sd +" "+ h +":"+ m +":"+ s; + start_date = makeTimeStamp(event.start); url = '/Schedule/schedule-show/format/json'; @@ -240,17 +244,7 @@ function eventMenu(action, el, pos) { openScheduleDialog(event, time); } else if (method === 'clear-show') { - start = event.start; - - var sy, sm, sd, h, m, s, start_date; - sy = start.getFullYear(); - sm = start.getMonth() + 1; - sd = start.getDate(); - h = start.getHours(); - m = start.getMinutes(); - s = start.getSeconds(); - - start_date = sy+"-"+ sm +"-"+ sd +" "+ h +":"+ m +":"+ s; + start_date = makeTimeStamp(event.start); url = '/Schedule/clear-show/format/json';