airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata-php-gateway git commit: fixing date time issue in experiment statisitics
Date Mon, 08 Feb 2016 16:15:15 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 17875457b -> 67f8c162e


fixing date time issue in experiment statisitics


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/67f8c162
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/67f8c162
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/67f8c162

Branch: refs/heads/develop
Commit: 67f8c162e86da0b9737e67e5599ce77f1bc4278f
Parents: 1787545
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Mon Feb 8 11:15:11 2016 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Mon Feb 8 11:15:11 2016 -0500

----------------------------------------------------------------------
 app/views/admin/manage-experiments.blade.php | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/67f8c162/app/views/admin/manage-experiments.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-experiments.blade.php b/app/views/admin/manage-experiments.blade.php
index c29212e..26a2e4d 100644
--- a/app/views/admin/manage-experiments.blade.php
+++ b/app/views/admin/manage-experiments.blade.php
@@ -396,28 +396,32 @@ to be uncommented when actually in use.
     });
 
     $(".oneDayExp").click( function(){
-        todayDate = moment().format('MM/DD/YYYY hh:mm A');
-        ydayDate = moment().subtract(1, "days").format('MM/DD/YYYY hh:mm A');
+        var todayDate = getCurrentDate();
+        var ydayDate = getCurrentDate(1);
         $("#datetimepicker9").find("input").val( ydayDate);
         $("#datetimepicker10").find("input").val( todayDate);
+        todayDate = moment(todayDate).utc().format('MM/DD/YYYY hh:mm a');
+        ydayDate = moment(ydayDate).utc().format('MM/DD/YYYY hh:mm a');
         var msg = "Experiments statistics from last 24 hours";
         getExperiments( ydayDate, todayDate, msg);
     });
 
     $(".oneWeekExp").click( function(){
-        todayDate = moment().format('MM/DD/YYYY hh:mm A');
-        ydayDate = moment().subtract(7, "days").format('MM/DD/YYYY hh:mm A');
+        var todayDate = getCurrentDate();
+        var ydayDate = getCurrentDate(7);
         $("#datetimepicker9").find("input").val( ydayDate);
         $("#datetimepicker10").find("input").val( todayDate);
+        todayDate = moment(todayDate).utc().format('MM/DD/YYYY hh:mm a');
+        ydayDate = moment(ydayDate).utc().format('MM/DD/YYYY hh:mm a');
         var msg = "Experiments statistics from last week";
         getExperiments( ydayDate, todayDate, msg);
     })
 
     $("#getStatistics").click(function () {
         $fromTime = $("#datetimepicker9").find("input").val();
-        $fromTime = moment($fromTime).format('MM/DD/YYYY hh:mm A');
+        $fromTime = moment($fromTime).utc().format('MM/DD/YYYY hh:mm A');
         $toTime = $("#datetimepicker10").find("input").val();
-        $toTime = moment($toTime).format('MM/DD/YYYY hh:mm A');
+        $toTime = moment($toTime).utc().format('MM/DD/YYYY hh:mm A');
         if ($fromTime == '' || $toTime == '') {
             alert("Please Select Valid Date Inputs!");
         } else {
@@ -447,7 +451,7 @@ to be uncommented when actually in use.
 
     function getCurrentDate( subtractDaysFromToday){
         var cd =  new Date();
-        var hours = cd.getUTCHours();
+        var hours = cd.getHours();
         month = cd.getMonth() + 1; //getmonth()starts from 0 for some reason
         var timeOfDay = "AM";
         if(hours >= 12)


Mime
View raw message