Skip to content

Commit

Permalink
Merge pull request #3899 from camptocamp/fix_datepicker_GSGMF-462
Browse files Browse the repository at this point in the history
Fix datepicker
  • Loading branch information
sbrunner authored May 23, 2018
2 parents 2aa867c + 073e068 commit c53d842
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/filter/ruleComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ exports.RuleController_ = class {
* @export
*/
this.timeRangeMode = {
widget: /** @type {ngeox.TimePropertyWidgetEnum} */ ('datepicker'),
widget: 'datepicker',
maxValue: this.createDate_(),
minValue: this.createWeekAgoDate_(),
maxDefValue: null,
minDefValue: null,
mode: /** @type {ngeox.TimePropertyModeEnum} */ ('range'),
mode: 'range',
interval: [0, 1, 0, 0]
};

Expand All @@ -243,12 +243,12 @@ exports.RuleController_ = class {
* @export
*/
this.timeValueMode = {
widget: /** @type {ngeox.TimePropertyWidgetEnum} */ ('datepicker'),
widget: 'datepicker',
maxValue: this.createDate_(),
minValue: this.createDate_(),
maxDefValue: null,
minDefValue: null,
mode: /** @type {ngeox.TimePropertyModeEnum} */ ('value'),
mode: 'value',
interval: [0, 1, 0, 0]
};

Expand Down
6 changes: 3 additions & 3 deletions src/filter/rulecomponent.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
ng-switch-when="date|datetime"
ng-switch-when-separator="|">
<div ng-switch="$ctrl.clone.operator">
<div ng-switch-when="..">
<div ng-switch-when="..|time_during" ng-switch-when-separator="|">
<ngeo-date-picker
time="$ctrl.timeRangeMode"
on-date-selected="$ctrl.onDateRangeSelected(time)">
Expand Down Expand Up @@ -237,7 +237,7 @@
ng-switch-when="date|datetime"
ng-switch-when-separator="|">
<div ng-switch="$ctrl.rule.operator">
<div ng-switch-when="..">
<div ng-switch-when="..|time_during" ng-switch-when-separator="|">
<span translate>From </span>
<span>{{ $ctrl.timeToDate($ctrl.rule.lowerBoundary) }}</span>
<span translate> to </span>
Expand Down Expand Up @@ -284,7 +284,7 @@

<div ng-switch-default>
<div ng-switch="$ctrl.rule.operator">
<div ng-switch-when="..">
<div ng-switch-when="..|time_during" ng-switch-when-separator="|">
<span translate>Between </span>
<span>{{ $ctrl.rule.lowerBoundary }}</span>
<span translate> and </span>
Expand Down
6 changes: 6 additions & 0 deletions src/misc/datepickerComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import ngeoMiscTime from 'ngeo/misc/Time.js';
import 'angular-ui-date';
import 'jquery-ui/themes/base/all.css';

// FIXME: import the locales in the applications
import 'jquery-ui/ui/i18n/datepicker-fr.js';
import 'jquery-ui/ui/i18n/datepicker-en-GB.js';
import 'jquery-ui/ui/i18n/datepicker-de.js';
import 'jquery-ui/ui/i18n/datepicker-it.js';


/**
* @type {!angular.Module}
Expand Down

0 comments on commit c53d842

Please sign in to comment.