-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the date field in the attribute editor
- Loading branch information
Showing
21 changed files
with
230 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ globals: | |
inject: false | ||
jsts: false | ||
moment: false | ||
DateFormatter: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
*.pyc | ||
.*.swp | ||
.transifexrc | ||
/.transifexrc | ||
/package-lock.json | ||
/.build | ||
/node_modules | ||
/dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* @param {Object.<string,*>} options | ||
*/ | ||
jQuery.datetimepicker = function(options) {}; | ||
|
||
/** | ||
* @param {string} lang | ||
*/ | ||
jQuery.datetimepicker.setLocale = function(lang) {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* @constructor | ||
*/ | ||
var DateFormatter = function() {}; | ||
|
||
/** | ||
* @param {!Date} date | ||
* @param {string} format | ||
* @return {string} | ||
*/ | ||
DateFormatter.prototype.formatDate = function(date, format) {}; | ||
|
||
/** | ||
* @param {string} date | ||
* @param {string} format | ||
* @return {!Date} | ||
*/ | ||
DateFormatter.prototype.parseDate = function(date, format) {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
goog.provide('ngeo.datetimepickerDirective'); | ||
|
||
goog.require('ngeo'); | ||
|
||
// Don't forget to add module dependencies | ||
|
||
|
||
/** | ||
* A directive used to display a date or time picker | ||
* | ||
* Example: | ||
* | ||
* <input ngeo-datetimepicker | ||
* ngeo-datetimepicker-options="{timepicker: false}" | ||
* | ||
* @htmlAttribute {Object} ngeo-datetimepicker-options The options. | ||
* | ||
* @return {angular.Directive} The directive specs. | ||
* @ngdoc directive | ||
* @ngname ngeoDatetimepicker | ||
*/ | ||
ngeo.datetimepickerDirective = function() { | ||
return { | ||
restrict: 'A', | ||
controller: ngeo.DatetimepickerController, | ||
bindToController: true, | ||
scope: { | ||
'options': '<ngeoDatetimepickerOptions' | ||
} | ||
}; | ||
}; | ||
|
||
ngeo.module.directive('ngeoDatetimepicker', ngeo.datetimepickerDirective); | ||
|
||
|
||
/** | ||
* @param {!jQuery} $element Element. | ||
* @param {!angularGettext.Catalog} gettextCatalog service. | ||
* @constructor | ||
* @private | ||
* @struct | ||
* @ngInject | ||
* @ngdoc controller | ||
* @ngname ngeoDatetimepickerController | ||
*/ | ||
ngeo.DatetimepickerController = function($element, gettextCatalog) { | ||
/** | ||
* @const {!jQuery} | ||
* @private | ||
*/ | ||
this.element_ = $element; | ||
|
||
/** | ||
* The gettext catalog | ||
* @type {!angularGettext.Catalog} | ||
* @private | ||
*/ | ||
this.gettextCatalog_ = gettextCatalog; | ||
|
||
/** | ||
* The options | ||
* @type {Object|String} | ||
* @private | ||
*/ | ||
this.options; | ||
}; | ||
|
||
|
||
/** | ||
* Initialize the directive. | ||
*/ | ||
ngeo.DatetimepickerController.prototype.$onInit = function() { | ||
const lang = this.gettextCatalog_.getCurrentLanguage(); | ||
$.datetimepicker.setLocale(lang); | ||
if (typeof this.options === 'string') { | ||
this.options = angular.fromJson(this.options); | ||
} | ||
this.element_.datetimepicker(this.options); | ||
}; |
Oops, something went wrong.