@@ -687,17 +687,20 @@ describe('input', function() {
687
687
expect ( $rootScope . form . alias . $error . month ) . toBeTruthy ( ) ;
688
688
} ) ;
689
689
690
- it ( 'should allow four or more digits in year' , function ( ) {
691
- var inputElm = helper . compileInput ( '<input type="month" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>' ) ;
692
690
693
- helper . changeInputValueTo ( '10123-03' ) ;
694
- expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 2 , 1 , 0 , 0 , 0 ) ) ;
691
+ if ( ! edge ) {
692
+ it ( 'should allow four or more digits in year' , function ( ) {
693
+ var inputElm = helper . compileInput ( '<input type="month" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>' ) ;
695
694
696
- $rootScope . $apply ( function ( ) {
697
- $rootScope . value = new Date ( Date . UTC ( 20456 , 3 , 1 , 0 , 0 , 0 ) ) ;
695
+ helper . changeInputValueTo ( '10123-03' ) ;
696
+ expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 2 , 1 , 0 , 0 , 0 ) ) ;
697
+
698
+ $rootScope . $apply ( function ( ) {
699
+ $rootScope . value = new Date ( Date . UTC ( 20456 , 3 , 1 , 0 , 0 , 0 ) ) ;
700
+ } ) ;
701
+ expect ( inputElm . val ( ) ) . toBe ( '20456-04' ) ;
698
702
} ) ;
699
- expect ( inputElm . val ( ) ) . toBe ( '20456-04' ) ;
700
- } ) ;
703
+ }
701
704
702
705
703
706
it ( 'should only change the month of a bound date' , function ( ) {
@@ -898,17 +901,19 @@ describe('input', function() {
898
901
expect ( inputElm ) . toBeValid ( ) ;
899
902
} ) ;
900
903
901
- it ( 'should allow four or more digits in year' , function ( ) {
902
- var inputElm = helper . compileInput ( '<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>' ) ;
904
+ if ( ! edge ) {
905
+ it ( 'should allow four or more digits in year' , function ( ) {
906
+ var inputElm = helper . compileInput ( '<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>' ) ;
903
907
904
- helper . changeInputValueTo ( '10123-W03' ) ;
905
- expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 0 , 21 ) ) ;
908
+ helper . changeInputValueTo ( '10123-W03' ) ;
909
+ expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 0 , 21 ) ) ;
906
910
907
- $rootScope . $apply ( function ( ) {
908
- $rootScope . value = new Date ( Date . UTC ( 20456 , 0 , 28 ) ) ;
911
+ $rootScope . $apply ( function ( ) {
912
+ $rootScope . value = new Date ( Date . UTC ( 20456 , 0 , 28 ) ) ;
913
+ } ) ;
914
+ expect ( inputElm . val ( ) ) . toBe ( '20456-W04' ) ;
909
915
} ) ;
910
- expect ( inputElm . val ( ) ) . toBe ( '20456-W04' ) ;
911
- } ) ;
916
+ }
912
917
913
918
it ( 'should use UTC if specified in the options' , function ( ) {
914
919
var inputElm = helper . compileInput ( '<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />' ) ;
@@ -1194,18 +1199,22 @@ describe('input', function() {
1194
1199
expect ( + $rootScope . value ) . toBe ( + new Date ( 2000 , 0 , 1 , 1 , 2 , 0 ) ) ;
1195
1200
} ) ;
1196
1201
1197
- it ( 'should allow four or more digits in year' , function ( ) {
1198
- var inputElm = helper . compileInput ( '<input type="datetime-local" ng-model="value" />' ) ;
1199
1202
1200
- helper . changeInputValueTo ( '10123-01-01T01:02' ) ;
1201
- expect ( + $rootScope . value ) . toBe ( + new Date ( 10123 , 0 , 1 , 1 , 2 , 0 ) ) ;
1203
+ if ( ! edge ) {
1204
+ it ( 'should allow four or more digits in year' , function ( ) {
1205
+ var inputElm = helper . compileInput ( '<input type="datetime-local" ng-model="value" />' ) ;
1206
+
1207
+ helper . changeInputValueTo ( '10123-01-01T01:02' ) ;
1208
+ expect ( + $rootScope . value ) . toBe ( + new Date ( 10123 , 0 , 1 , 1 , 2 , 0 ) ) ;
1209
+
1210
+ $rootScope . $apply ( function ( ) {
1211
+ $rootScope . value = new Date ( 20456 , 1 , 1 , 1 , 2 , 0 ) ;
1212
+ } ) ;
1213
+ expect ( inputElm . val ( ) ) . toBe ( '20456-02-01T01:02:00.000' ) ;
1214
+ }
1215
+ ) ;
1216
+ }
1202
1217
1203
- $rootScope . $apply ( function ( ) {
1204
- $rootScope . value = new Date ( 20456 , 1 , 1 , 1 , 2 , 0 ) ;
1205
- } ) ;
1206
- expect ( inputElm . val ( ) ) . toBe ( '20456-02-01T01:02:00.000' ) ;
1207
- }
1208
- ) ;
1209
1218
1210
1219
it ( 'should label parse errors as `datetimelocal`' , function ( ) {
1211
1220
var inputElm = helper . compileInput ( '<input type="datetime-local" ng-model="val" name="alias" />' , {
@@ -1799,19 +1808,20 @@ describe('input', function() {
1799
1808
}
1800
1809
) ;
1801
1810
1802
- it ( 'should allow four or more digits in year' , function ( ) {
1803
- var inputElm = helper . compileInput ( '<input type="date" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />' ) ;
1804
-
1805
- helper . changeInputValueTo ( '10123-01-01' ) ;
1806
- expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 0 , 1 , 0 , 0 , 0 ) ) ;
1811
+ if ( ! edge ) {
1812
+ it ( 'should allow four or more digits in year' , function ( ) {
1813
+ var inputElm = helper . compileInput ( '<input type="date" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />' ) ;
1807
1814
1808
- $rootScope . $apply ( function ( ) {
1809
- $rootScope . value = new Date ( Date . UTC ( 20456 , 1 , 1 , 0 , 0 , 0 ) ) ;
1810
- } ) ;
1811
- expect ( inputElm . val ( ) ) . toBe ( '20456-02-01' ) ;
1812
- }
1813
- ) ;
1815
+ helper . changeInputValueTo ( '10123-01-01' ) ;
1816
+ expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 0 , 1 , 0 , 0 , 0 ) ) ;
1814
1817
1818
+ $rootScope . $apply ( function ( ) {
1819
+ $rootScope . value = new Date ( Date . UTC ( 20456 , 1 , 1 , 0 , 0 , 0 ) ) ;
1820
+ } ) ;
1821
+ expect ( inputElm . val ( ) ) . toBe ( '20456-02-01' ) ;
1822
+ }
1823
+ ) ;
1824
+ }
1815
1825
1816
1826
it ( 'should label parse errors as `date`' , function ( ) {
1817
1827
var inputElm = helper . compileInput ( '<input type="date" ng-model="val" name="alias" />' , {
0 commit comments