Repository: ambari Updated Branches: refs/heads/trunk 4bd4b3ca5 -> 4b6fe031e
AMBARI-16132. Date Filter editable in History Tab (pallavkul) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4b6fe031 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4b6fe031 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4b6fe031 Branch: refs/heads/trunk Commit: 4b6fe031eb1aa0384104767a96e8afe580ad4198 Parents: 4bd4b3c Author: Pallav Kulshreshtha <pallav....@gmail.com> Authored: Thu May 12 13:39:58 2016 +0530 Committer: Pallav Kulshreshtha <pallav....@gmail.com> Committed: Thu May 12 13:39:58 2016 +0530 ---------------------------------------------------------------------- .../ui/hive-web/app/components/date-range-widget.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4b6fe031/contrib/views/hive/src/main/resources/ui/hive-web/app/components/date-range-widget.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/date-range-widget.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/date-range-widget.js index 9e38786..a9315ba 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/date-range-widget.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/date-range-widget.js @@ -68,6 +68,7 @@ export default Ember.Component.extend({ this.$(".toDate").datepicker({ defaultDate: new Date(dateRange.get('to')), + minDate: new Date(dateRange.get('from')), onSelect: function (selectedDate) { @@ -80,6 +81,18 @@ export default Ember.Component.extend({ } }); + this.$(".fromDate").on('blur', () => { + if(moment(self.$(".fromDate").val(), 'MM/DD/YYYY', true).format() === 'Invalid date'){ + self.$(".fromDate").val('') + } + }); + + this.$(".toDate").on('blur', () => { + if(moment(self.$(".toDate").val(), 'MM/DD/YYYY', true).format() === 'Invalid date'){ + self.$(".toDate").val('') + } + }); + this.set('rendered', true); } });