@@ -14,7 +14,6 @@ import {
14
14
} from '@angular/core' ;
15
15
import { IGX_TIME_PICKER_COMPONENT , IgxTimePickerBase } from './time-picker.common' ;
16
16
import { InteractionMode } from '../core/enums' ;
17
- import { DatePickerUtil } from '../date-picker/date-picker.utils' ;
18
17
19
18
/** @hidden */
20
19
@Directive ( {
@@ -243,15 +242,6 @@ export class IgxHourItemDirective {
243
242
@Input ( 'igxHourItem' )
244
243
public value : string ;
245
244
246
- @Input ( 'minValueDate' )
247
- public minValueDate : Date ;
248
-
249
- @Input ( 'maxValueDate' )
250
- public maxValueDate : Date ;
251
-
252
- @Input ( 'selectedAmPm' )
253
- public selectedAmPm : string ;
254
-
255
245
@HostBinding ( 'class.igx-time-picker__item' )
256
246
get defaultCSS ( ) : boolean {
257
247
return true ;
@@ -267,20 +257,6 @@ export class IgxHourItemDirective {
267
257
return this . isSelectedHour && this . itemList . isActive ;
268
258
}
269
259
270
- @HostBinding ( 'class.igx-time-picker__item--disabled' )
271
- get applyDisabledStyleForHours ( ) : boolean {
272
- if ( ! this . minValueDate || ! this . maxValueDate ) {
273
- return false ;
274
- }
275
- let hour = parseInt ( this . value , 10 ) ;
276
- if ( this . selectedAmPm === 'PM' ) {
277
- hour += 12 ;
278
- }
279
- const date = new Date ( this . minValueDate ) ;
280
- date . setHours ( hour ) ;
281
- return ( DatePickerUtil . lessThanMinValue ( date , this . minValueDate ) || DatePickerUtil . greaterThanMaxValue ( date , this . maxValueDate ) ) ;
282
- }
283
-
284
260
get isSelectedHour ( ) : boolean {
285
261
return this . timePicker . selectedHour === this . value ;
286
262
}
@@ -308,18 +284,6 @@ export class IgxMinuteItemDirective {
308
284
@Input ( 'igxMinuteItem' )
309
285
public value : string ;
310
286
311
- @Input ( 'selectedHour' )
312
- public selectedHour : string ;
313
-
314
- @Input ( 'minValueDate' )
315
- public minValueDate : Date ;
316
-
317
- @Input ( 'maxValueDate' )
318
- public maxValueDate : Date ;
319
-
320
- @Input ( 'selectedAmPm' )
321
- public selectedAmPm : string ;
322
-
323
287
@HostBinding ( 'class.igx-time-picker__item' )
324
288
get defaultCSS ( ) : boolean {
325
289
return true ;
@@ -335,22 +299,6 @@ export class IgxMinuteItemDirective {
335
299
return this . isSelectedMinute && this . itemList . isActive ;
336
300
}
337
301
338
- @HostBinding ( 'class.igx-time-picker__item--disabled' )
339
- get applyDisabledStyleForMinutes ( ) : boolean {
340
- if ( ! this . minValueDate || ! this . maxValueDate ) {
341
- return false ;
342
- }
343
- const minute = parseInt ( this . value , 10 ) ;
344
- let hour = parseInt ( this . selectedHour , 10 ) ;
345
- if ( this . selectedAmPm === 'PM' ) {
346
- hour += 12 ;
347
- }
348
- const date = new Date ( this . minValueDate ) ;
349
- date . setHours ( hour ) ;
350
- date . setMinutes ( minute ) ;
351
- return ( DatePickerUtil . lessThanMinValue ( date , this . minValueDate ) || DatePickerUtil . greaterThanMaxValue ( date , this . maxValueDate ) ) ;
352
- }
353
-
354
302
get isSelectedMinute ( ) : boolean {
355
303
return this . timePicker . selectedMinute === this . value ;
356
304
}
@@ -378,21 +326,6 @@ export class IgxSecondsItemDirective {
378
326
@Input ( 'igxSecondsItem' )
379
327
public value : string ;
380
328
381
- @Input ( 'selectedHour' )
382
- public selectedHour : string ;
383
-
384
- @Input ( 'selectedMinute' )
385
- public selectedMinute : string ;
386
-
387
- @Input ( 'minValueDate' )
388
- public minValueDate : Date ;
389
-
390
- @Input ( 'maxValueDate' )
391
- public maxValueDate : Date ;
392
-
393
- @Input ( 'selectedAmPm' )
394
- public selectedAmPm : string ;
395
-
396
329
@HostBinding ( 'class.igx-time-picker__item' )
397
330
get defaultCSS ( ) : boolean {
398
331
return true ;
@@ -408,24 +341,6 @@ export class IgxSecondsItemDirective {
408
341
return this . isSelectedSeconds && this . itemList . isActive ;
409
342
}
410
343
411
- @HostBinding ( 'class.igx-time-picker__item--disabled' )
412
- get applyDisabledStyleForSeconds ( ) : boolean {
413
- if ( ! this . minValueDate || ! this . maxValueDate ) {
414
- return false ;
415
- }
416
- const minute = parseInt ( this . selectedMinute , 10 ) ;
417
- let hour = parseInt ( this . selectedHour , 10 ) ;
418
- const second = parseInt ( this . value , 10 ) ;
419
- if ( this . selectedAmPm === 'PM' ) {
420
- hour += 12 ;
421
- }
422
- const date = new Date ( this . minValueDate ) ;
423
- date . setHours ( hour ) ;
424
- date . setMinutes ( minute ) ;
425
- date . setSeconds ( second ) ;
426
- return ( DatePickerUtil . lessThanMinValue ( date , this . minValueDate ) || DatePickerUtil . greaterThanMaxValue ( date , this . maxValueDate ) ) ;
427
- }
428
-
429
344
get isSelectedSeconds ( ) : boolean {
430
345
return this . timePicker . selectedSeconds === this . value ;
431
346
}
@@ -453,21 +368,6 @@ export class IgxAmPmItemDirective {
453
368
@Input ( 'igxAmPmItem' )
454
369
public value : string ;
455
370
456
- @Input ( 'selectedHour' )
457
- public selectedHour : string ;
458
-
459
- @Input ( 'selectedMinute' )
460
- public selectedMinute : string ;
461
-
462
- @Input ( 'selectedSecond' )
463
- public selectedSecond : string ;
464
-
465
- @Input ( 'minValueDate' )
466
- public minValueDate : Date ;
467
-
468
- @Input ( 'maxValueDate' )
469
- public maxValueDate : Date ;
470
-
471
371
@HostBinding ( 'class.igx-time-picker__item' )
472
372
get defaultCSS ( ) : boolean {
473
373
return true ;
@@ -483,25 +383,6 @@ export class IgxAmPmItemDirective {
483
383
return this . isSelectedAmPm && this . itemList . isActive ;
484
384
}
485
385
486
- @HostBinding ( 'class.igx-time-picker__item--disabled' )
487
- get applyDisabledStyleForAmPm ( ) : boolean {
488
- if ( ! this . minValueDate || ! this . maxValueDate ) {
489
- return false ;
490
- }
491
- const minute = parseInt ( this . selectedMinute , 10 ) ;
492
- let hour = parseInt ( this . selectedHour , 10 ) ;
493
- const second = parseInt ( this . selectedSecond , 10 ) ;
494
- const amPM = this . value ;
495
- if ( amPM === 'PM' ) {
496
- hour += 12 ;
497
- }
498
- const date = new Date ( this . minValueDate ) ;
499
- date . setHours ( hour ) ;
500
- date . setMinutes ( minute ) ;
501
- date . setSeconds ( second ) ;
502
- return ( DatePickerUtil . lessThanMinValue ( date , this . minValueDate ) || DatePickerUtil . greaterThanMaxValue ( date , this . maxValueDate ) ) ;
503
- }
504
-
505
386
get isSelectedAmPm ( ) : boolean {
506
387
return this . timePicker . selectedAmPm === this . value ;
507
388
}
0 commit comments