Repository: ambari Updated Branches: refs/heads/branch-2.5 14ecaca4d -> af00bc6d4
AMBARI-19469 Log Search: Calendar widget for setting the time range is confusing (mgergely) Change-Id: I02e6b6e1f3fbebed04ad8e8c96bf016d4c0aaa73 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/af00bc6d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/af00bc6d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/af00bc6d Branch: refs/heads/branch-2.5 Commit: af00bc6d498eb5410d893324fce10ebab78ef652 Parents: 14ecaca Author: Miklos Gergely <[email protected]> Authored: Thu Jan 12 17:59:41 2017 +0100 Committer: Miklos Gergely <[email protected]> Committed: Thu Jan 12 17:59:41 2017 +0100 ---------------------------------------------------------------------- .../libs/other/daterangepicker/js/daterangepicker.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/af00bc6d/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/js/daterangepicker.js ---------------------------------------------------------------------- diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/js/daterangepicker.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/js/daterangepicker.js index 04798c6..dc571e8 100644 --- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/js/daterangepicker.js +++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/js/daterangepicker.js @@ -650,12 +650,9 @@ //populate the calendar with date objects var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1; - if (startDay > daysInLastMonth) + if (startDay > daysInLastMonth + 1) startDay -= 7; - if (dayOfWeek == this.locale.firstDay) - startDay = daysInLastMonth - 6; - var curDate = moment([lastYear, lastMonth, startDay, 12, minute, second]); var col, row; @@ -663,6 +660,8 @@ if (i > 0 && col % 7 === 0) { col = 0; row++; + if (curDate.month() != month) + break } calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second); curDate.hour(12); @@ -707,7 +706,7 @@ html += '<th></th>'; } - var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(" YYYY"); + var dateHtml = this.locale.monthNames[calendar[1][1].month()] + " " + calendar[1][1].year(); if (this.showDropdowns) { var currentMonth = calendar[1][1].month(); @@ -774,6 +773,9 @@ } for (var row = 0; row < 6; row++) { + if (calendar[row].length == 0) + continue + html += '<tr>'; // add week number
