mirror of https://github.com/apache/druid.git
Merge pull request #1098 from metamx/Enable_full_iso8601_durations_in_console
better regex for durations
This commit is contained in:
commit
9f353ca2bd
|
@ -11829,7 +11829,7 @@ app.directive('isoDuration', function() {
|
||||||
require: 'ngModel',
|
require: 'ngModel',
|
||||||
link: function($scope, $el, $attrs, $ctrl) {
|
link: function($scope, $el, $attrs, $ctrl) {
|
||||||
var durationRegex;
|
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) {
|
return $ctrl.$parsers.unshift(function(viewValue) {
|
||||||
if (viewValue == null) {
|
if (viewValue == null) {
|
||||||
$ctrl.$setValidity('isoDuration', true);
|
$ctrl.$setValidity('isoDuration', true);
|
||||||
|
|
Loading…
Reference in New Issue