mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-12 21:59:43 +00:00
(js) Handle non-latin characters in date validator
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
4.0.7 (YYYY-MM-DD)
|
||||
------------------
|
||||
|
||||
Bug fixes
|
||||
- [web] date validator now handles non-latin characters
|
||||
|
||||
4.0.6 (2019-02-21)
|
||||
------------------
|
||||
|
||||
|
||||
@@ -154,6 +154,13 @@
|
||||
_this.$mdDateLocaleProvider.formatTime = function(date) {
|
||||
return date? date.format(_this.$mdDateLocaleProvider, _this.defaults.SOGoTimeFormat) : '';
|
||||
};
|
||||
_this.$mdDateLocaleProvider.isDateComplete = function(dateString) {
|
||||
dateString = dateString.trim();
|
||||
// The default function of Angular Material doesn't handle non-latin characters.
|
||||
// This one does.
|
||||
var re = /^((([a-zA-Z]|[^\x00-\x7F]){3,}|[0-9]{1,4})([ .,]+|[/-])){2}(([a-zA-Z]|[^\x00-\x7F]){3,}|[0-9]{1,4})$/;
|
||||
return re.test(dateString);
|
||||
};
|
||||
}
|
||||
|
||||
settingsElement = Preferences.$document[0].getElementById('UserSettings');
|
||||
|
||||
Reference in New Issue
Block a user