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