Repository: ambari Updated Branches: refs/heads/branch-2.5 ca006571f -> 14ecaca4d
AMBARI-19461 Log Search: default search ranges don't look right (mgergely) Change-Id: Ibb3f4884b55a3740b92f61f86f4fe0e6164000f7 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/14ecaca4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/14ecaca4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/14ecaca4 Branch: refs/heads/branch-2.5 Commit: 14ecaca4dc109a0b799b236f91e1aa850f55435e Parents: ca00657 Author: Miklos Gergely <[email protected]> Authored: Thu Jan 12 17:56:42 2017 +0100 Committer: Miklos Gergely <[email protected]> Committed: Thu Jan 12 17:56:42 2017 +0100 ---------------------------------------------------------------------- .../src/main/webapp/scripts/utils/Utils.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/14ecaca4/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js ---------------------------------------------------------------------- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js index 94a8a5b..924f92f 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js @@ -839,26 +839,27 @@ define(['require', moment.tz.setDefault(zone) } this.getRelativeDateString =function(){} - this.getLast1HourRange = function(){ - return [moment().hour(moment().hours() - 1).minute(moment().minutes() - 1).seconds(moment().seconds() - 1), moment().hour(moment().hours()).minute(moment().minutes()).seconds(moment().seconds())]; + this.getLast1HourRange = function() { + var m = moment() + return [moment().hour(m.hours() - 1).minute(m.minutes()).seconds(m.seconds()).milliseconds(m.milliseconds() + 1), moment().hour(m.hours()).minute(m.minutes()).seconds(m.seconds()).milliseconds(m.milliseconds())]; } - this.getTodayRange = function() { - return [moment().hour('0').minute('0').seconds('01').milliseconds("000"), moment().hour('23').minute('59').seconds('59').milliseconds("999")]; + this.getTodayRange = function() { + return [moment().hour('0').minute('0').seconds('0').milliseconds("000"), moment().hour('23').minute('59').seconds('59').milliseconds("999")]; } this.getYesterdayRange = function() { - return [moment().subtract(1, 'days').hour('0').minute('0').seconds('01').milliseconds("000"), moment().subtract(1, 'days').hour('23').minute('59').seconds('59').milliseconds("999")]; + return [moment().subtract(1, 'days').hour('0').minute('0').seconds('0').milliseconds("000"), moment().subtract(1, 'days').hour('23').minute('59').seconds('59').milliseconds("999")]; } this.getLast7DaysRange = function() { - return [moment().subtract(6, 'days').hour('0').minute('0').seconds('01').milliseconds("000"), moment().hour('23').minute('59').seconds('59').milliseconds("999")]; + return [moment().subtract(6, 'days').hour('0').minute('0').seconds('0').milliseconds("000"), moment().hour('23').minute('59').seconds('59').milliseconds("999")]; } this.getLast30DaysRange = function() { - return [moment().subtract(29, 'days').hour('0').minute('0').seconds('01').milliseconds("000"), moment().hour('23').minute('59').seconds('59').milliseconds("999")]; + return [moment().subtract(29, 'days').hour('0').minute('0').seconds('0').milliseconds("000"), moment().hour('23').minute('59').seconds('59').milliseconds("999")]; } this.getThisMonthRange = function() { - return [moment().startOf('month').hour('0').minute('0').seconds('01').milliseconds("000"), moment().endOf('month').hour('23').minute('59').seconds('59').milliseconds("999")]; + return [moment().startOf('month').hour('0').minute('0').seconds('0').milliseconds("000"), moment().endOf('month').hour('23').minute('59').seconds('59').milliseconds("999")]; } this.getLastMonthRange = function() { - return [moment().subtract(1, 'month').startOf('month').hour('0').minute('0').seconds('01').milliseconds("000"), moment().subtract(1, 'month').endOf('month').hour('23').minute('59').seconds('59').milliseconds("999")]; + return [moment().subtract(1, 'month').startOf('month').hour('0').minute('0').seconds('0').milliseconds("000"), moment().subtract(1, 'month').endOf('month').hour('23').minute('59').seconds('59').milliseconds("999")]; } this.getOneDayTimeDiff = function(checkTime) { var hourDiff = checkTime.getHourDiff();
