mirror of https://github.com/apache/druid.git
better regex for durations
This commit is contained in:
parent
1ee4f7cc13
commit
a0fc20fc09
|
@ -11829,7 +11829,7 @@ app.directive('isoDuration', function() {
|
|||
require: 'ngModel',
|
||||
link: function($scope, $el, $attrs, $ctrl) {
|
||||
var durationRegex;
|
||||
durationRegex = /^P(((\d+)Y)?((\d)+M)?((\d)+D)?|(\d)+W)$/;
|
||||
durationRegex = /^P(?=\w*\d)(?:\d+Y|Y)?(?:\d+M|M)?(?:\d+W|W)?(?:\d+D|D)?(?:T(?:\d+H|H)?(?:\d+M|M)?(?:\d+(?:\.\d{1,2})?S|S)?)?$/;
|
||||
return $ctrl.$parsers.unshift(function(viewValue) {
|
||||
if (viewValue == null) {
|
||||
$ctrl.$setValidity('isoDuration', true);
|
||||
|
|
Loading…
Reference in New Issue