@@ -657,17 +657,20 @@ describe('input', function() {
657
657
expect ( $rootScope . form . alias . $error . month ) . toBeTruthy ( ) ;
658
658
} ) ;
659
659
660
- it ( 'should allow four or more digits in year' , function ( ) {
661
- var inputElm = helper . compileInput ( '<input type="month" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>' ) ;
662
660
663
- helper . changeInputValueTo ( '10123-03' ) ;
664
- expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 2 , 1 , 0 , 0 , 0 ) ) ;
661
+ if ( ! edge ) {
662
+ it ( 'should allow four or more digits in year' , function ( ) {
663
+ var inputElm = helper . compileInput ( '<input type="month" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>' ) ;
665
664
666
- $rootScope . $apply ( function ( ) {
667
- $rootScope . value = new Date ( Date . UTC ( 20456 , 3 , 1 , 0 , 0 , 0 ) ) ;
665
+ helper . changeInputValueTo ( '10123-03' ) ;
666
+ expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 2 , 1 , 0 , 0 , 0 ) ) ;
667
+
668
+ $rootScope . $apply ( function ( ) {
669
+ $rootScope . value = new Date ( Date . UTC ( 20456 , 3 , 1 , 0 , 0 , 0 ) ) ;
670
+ } ) ;
671
+ expect ( inputElm . val ( ) ) . toBe ( '20456-04' ) ;
668
672
} ) ;
669
- expect ( inputElm . val ( ) ) . toBe ( '20456-04' ) ;
670
- } ) ;
673
+ }
671
674
672
675
673
676
it ( 'should only change the month of a bound date' , function ( ) {
@@ -868,17 +871,19 @@ describe('input', function() {
868
871
expect ( inputElm ) . toBeValid ( ) ;
869
872
} ) ;
870
873
871
- it ( 'should allow four or more digits in year' , function ( ) {
872
- var inputElm = helper . compileInput ( '<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>' ) ;
874
+ if ( ! edge ) {
875
+ it ( 'should allow four or more digits in year' , function ( ) {
876
+ var inputElm = helper . compileInput ( '<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>' ) ;
873
877
874
- helper . changeInputValueTo ( '10123-W03' ) ;
875
- expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 0 , 21 ) ) ;
878
+ helper . changeInputValueTo ( '10123-W03' ) ;
879
+ expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 0 , 21 ) ) ;
876
880
877
- $rootScope . $apply ( function ( ) {
878
- $rootScope . value = new Date ( Date . UTC ( 20456 , 0 , 28 ) ) ;
881
+ $rootScope . $apply ( function ( ) {
882
+ $rootScope . value = new Date ( Date . UTC ( 20456 , 0 , 28 ) ) ;
883
+ } ) ;
884
+ expect ( inputElm . val ( ) ) . toBe ( '20456-W04' ) ;
879
885
} ) ;
880
- expect ( inputElm . val ( ) ) . toBe ( '20456-W04' ) ;
881
- } ) ;
886
+ }
882
887
883
888
it ( 'should use UTC if specified in the options' , function ( ) {
884
889
var inputElm = helper . compileInput ( '<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />' ) ;
@@ -1164,18 +1169,22 @@ describe('input', function() {
1164
1169
expect ( + $rootScope . value ) . toBe ( + new Date ( 2000 , 0 , 1 , 1 , 2 , 0 ) ) ;
1165
1170
} ) ;
1166
1171
1167
- it ( 'should allow four or more digits in year' , function ( ) {
1168
- var inputElm = helper . compileInput ( '<input type="datetime-local" ng-model="value" />' ) ;
1169
1172
1170
- helper . changeInputValueTo ( '10123-01-01T01:02' ) ;
1171
- expect ( + $rootScope . value ) . toBe ( + new Date ( 10123 , 0 , 1 , 1 , 2 , 0 ) ) ;
1173
+ if ( ! edge ) {
1174
+ it ( 'should allow four or more digits in year' , function ( ) {
1175
+ var inputElm = helper . compileInput ( '<input type="datetime-local" ng-model="value" />' ) ;
1176
+
1177
+ helper . changeInputValueTo ( '10123-01-01T01:02' ) ;
1178
+ expect ( + $rootScope . value ) . toBe ( + new Date ( 10123 , 0 , 1 , 1 , 2 , 0 ) ) ;
1179
+
1180
+ $rootScope . $apply ( function ( ) {
1181
+ $rootScope . value = new Date ( 20456 , 1 , 1 , 1 , 2 , 0 ) ;
1182
+ } ) ;
1183
+ expect ( inputElm . val ( ) ) . toBe ( '20456-02-01T01:02:00.000' ) ;
1184
+ }
1185
+ ) ;
1186
+ }
1172
1187
1173
- $rootScope . $apply ( function ( ) {
1174
- $rootScope . value = new Date ( 20456 , 1 , 1 , 1 , 2 , 0 ) ;
1175
- } ) ;
1176
- expect ( inputElm . val ( ) ) . toBe ( '20456-02-01T01:02:00.000' ) ;
1177
- }
1178
- ) ;
1179
1188
1180
1189
it ( 'should label parse errors as `datetimelocal`' , function ( ) {
1181
1190
var inputElm = helper . compileInput ( '<input type="datetime-local" ng-model="val" name="alias" />' , {
@@ -1769,19 +1778,20 @@ describe('input', function() {
1769
1778
}
1770
1779
) ;
1771
1780
1772
- it ( 'should allow four or more digits in year' , function ( ) {
1773
- var inputElm = helper . compileInput ( '<input type="date" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />' ) ;
1774
-
1775
- helper . changeInputValueTo ( '10123-01-01' ) ;
1776
- expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 0 , 1 , 0 , 0 , 0 ) ) ;
1781
+ if ( ! edge ) {
1782
+ it ( 'should allow four or more digits in year' , function ( ) {
1783
+ var inputElm = helper . compileInput ( '<input type="date" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />' ) ;
1777
1784
1778
- $rootScope . $apply ( function ( ) {
1779
- $rootScope . value = new Date ( Date . UTC ( 20456 , 1 , 1 , 0 , 0 , 0 ) ) ;
1780
- } ) ;
1781
- expect ( inputElm . val ( ) ) . toBe ( '20456-02-01' ) ;
1782
- }
1783
- ) ;
1785
+ helper . changeInputValueTo ( '10123-01-01' ) ;
1786
+ expect ( + $rootScope . value ) . toBe ( Date . UTC ( 10123 , 0 , 1 , 0 , 0 , 0 ) ) ;
1784
1787
1788
+ $rootScope . $apply ( function ( ) {
1789
+ $rootScope . value = new Date ( Date . UTC ( 20456 , 1 , 1 , 0 , 0 , 0 ) ) ;
1790
+ } ) ;
1791
+ expect ( inputElm . val ( ) ) . toBe ( '20456-02-01' ) ;
1792
+ }
1793
+ ) ;
1794
+ }
1785
1795
1786
1796
it ( 'should label parse errors as `date`' , function ( ) {
1787
1797
var inputElm = helper . compileInput ( '<input type="date" ng-model="val" name="alias" />' , {
0 commit comments