diff --git a/website/public/js/controllers/tasksCtrl.js b/website/public/js/controllers/tasksCtrl.js index 586e025c15..634847ad1a 100644 --- a/website/public/js/controllers/tasksCtrl.js +++ b/website/public/js/controllers/tasksCtrl.js @@ -137,22 +137,14 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N Dailies ------------------------ */ - $scope.updateTaskStartDate = function(task) { - /* - Keep startDate and _tempDateForPicker in sync. The reason for having both instead - of having startDate be the ngmodel for datePicker is that datePicker initializes with - an incorrect format when given a Date for an ngmodel; instead we initialize _tempDate - to be a string that datePicker then converts to a Date, which lets us control the format. - */ - task.startDate = task._tempDateForPicker; - }; $scope.openDatePicker = function($event, task) { + $event.preventDefault(); $event.stopPropagation(); + task._isDatePickerOpen = !task._isDatePickerOpen; } - /* ------------------------ Checklists diff --git a/website/views/shared/tasks/edit/advanced_options.jade b/website/views/shared/tasks/edit/advanced_options.jade index 10635fb7e3..a1c9284235 100644 --- a/website/views/shared/tasks/edit/advanced_options.jade +++ b/website/views/shared/tasks/edit/advanced_options.jade @@ -8,12 +8,12 @@ div(ng-if='::task.type!="reward"') .form-group legend.option-title=env.t('startDate') .input-group - input.form-control(type='date', ng-model='task._tempDateForPicker', - ng-change='updateTaskStartDate(task)', - is-open='task._isDatePickerOpen', datepicker-popup, required) + input.form-control(type='text', ng-model='task.startDate', + datepicker-popup='M/dd/yyyy', is-open='task._isDatePickerOpen', + ng-required='true', close-text='Close') span.input-group-btn button.btn.btn-default(type='button' ng-click='openDatePicker($event, task)') - .glyphicon.glyphicon-calendar + i.glyphicon.glyphicon-calendar hr