Skip to content

Commit

Permalink
improve "create event" usability: default expiration date for ticket …
Browse files Browse the repository at this point in the history
…categories is event start date
  • Loading branch information
cbellone committed Aug 28, 2016
1 parent 7ec811d commit c8ed624
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h4>Category visibility:</h4>
<div class="col-sm-12 col-md-4">
<div class="form-group" bs-form-error="ticketCategory.dateString">
<label for="{{buildPrefix($index, 'dateString')}}">Validity range</label>
<input type="text" data-date-range data-start-model="ticketCategory.inception" data-end-model="ticketCategory.expiration" data-watch-obj="event.start" data-start-date="ticketCategory.notBefore" data-ng-model="ticketCategory.dateString" name="{{buildPrefix($index, 'dateString')}}" id="{{buildPrefix($index, 'dateString')}}" class="form-control" required />
<input type="text" data-date-range data-start-model="ticketCategory.inception" data-end-model="ticketCategory.expiration" data-watch-obj="event.begin" data-start-date="ticketCategory.notBefore" data-ng-model="ticketCategory.dateString" name="{{buildPrefix($index, 'dateString')}}" id="{{buildPrefix($index, 'dateString')}}" class="form-control" required />
<field-error data-form-obj="ticketCategory" data-field-obj="ticketCategory.dateString" data-show-existing-errors="showExistingErrors"></field-error>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
}

if(scope.watchObj) {
var clearListener = scope.$watch(function() { return scope.watchObj; }, function(newVal, oldVal) {
var clearListener = scope.$watch('watchObj', function(newVal, oldVal) {
if(newVal && newVal['date']) {
var dr = pickerElement.data('daterangepicker');
if(angular.equals({date: dr.endDate.format('YYYY-MM-DD'), time: dr.endDate.format('HH:mm')}, oldVal)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,14 @@
date: now.format('YYYY-MM-DD'),
time: now.format('HH:mm')
};
var category = {
return {
inception: inceptionDateTime,
expiration: expirationDateTime,
tokenGenerationRequested: false,
sticky: sticky,
bounded: false
};

return category;

};

var createAndPushCategory = function(sticky, $scope) {
Expand Down

0 comments on commit c8ed624

Please sign in to comment.