File tree 2 files changed +1
-19
lines changed 2 files changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,7 @@ define([
339
339
* var julianDate = JulianDate.fromDate(date, TimeStandard.UTC);
340
340
*/
341
341
JulianDate . fromDate = function ( date , timeStandard ) {
342
- if ( ! defined ( date ) || date === null || isNaN ( date . getTime ( ) ) ) {
342
+ if ( ! ( date instanceof Date ) || isNaN ( date . getTime ( ) ) ) {
343
343
throw new DeveloperError ( 'date must be a valid JavaScript Date.' ) ;
344
344
}
345
345
Original file line number Diff line number Diff line change @@ -214,30 +214,12 @@ function(JulianDate,
214
214
} ) . toThrow ( ) ;
215
215
} ) ;
216
216
217
- it ( 'Fail to construct from a null JavaScript Date' , function ( ) {
218
- expect ( function ( ) {
219
- return JulianDate . fromDate ( null ) ;
220
- } ) . toThrow ( ) ;
221
- } ) ;
222
-
223
217
it ( 'Fail to construct from an invalid JavaScript Date' , function ( ) {
224
218
expect ( function ( ) {
225
219
return JulianDate . fromDate ( new Date ( Date . parse ( 'garbage' ) ) ) ;
226
220
} ) . toThrow ( ) ;
227
221
} ) ;
228
222
229
- it ( 'Fail to construct from a non-date JavaScript Date' , function ( ) {
230
- expect ( function ( ) {
231
- return JulianDate . fromDate ( 0 ) ;
232
- } ) . toThrow ( ) ;
233
- } ) ;
234
-
235
- it ( 'Fail to construct from a JavaScript Date with null time standard' , function ( ) {
236
- expect ( function ( ) {
237
- return JulianDate . fromDate ( new Date ( ) , null ) ;
238
- } ) . toThrow ( ) ;
239
- } ) ;
240
-
241
223
it ( 'Fail to construct from a JavaScript Date with invalid time standard' , function ( ) {
242
224
expect ( function ( ) {
243
225
return JulianDate . fromDate ( new Date ( ) , 'invalid' ) ;
You can’t perform that action at this time.
0 commit comments