File tree Expand file tree Collapse file tree 6 files changed +11
-6
lines changed
projects/igniteui-angular/src/lib Expand file tree Collapse file tree 6 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
2121import { CalendarDay , DayInterval } from "../common/model" ;
2222import { getNextActiveDate , isDateInRanges } from "./helpers" ;
2323import { DateRangeType } from "../../core/dates" ;
24+ import { isDate } from "../../core/utils" ;
2425
2526export enum Direction {
2627 NEXT = 1 ,
@@ -141,7 +142,7 @@ export abstract class IgxCalendarViewDirective implements ControlValueAccessor {
141142 */
142143 @Input ( )
143144 public set date ( value : Date ) {
144- if ( ! ( value instanceof Date ) ) return ;
145+ if ( ! isDate ( value ) ) return ;
145146
146147 this . _date = value ;
147148 }
Original file line number Diff line number Diff line change 1+ import { isDate } from "../../core/utils" ;
2+
13/* eslint-disable @typescript-eslint/consistent-type-definitions */
24export type DayParameter = CalendarDay | Date ;
35
@@ -19,7 +21,7 @@ export const daysInWeek = 7;
1921const millisecondsInDay = 86400000 ;
2022
2123export function toCalendarDay ( date : DayParameter ) {
22- return date instanceof Date ? CalendarDay . from ( date ) : date ;
24+ return isDate ( date ) ? CalendarDay . from ( date ) : date ;
2325}
2426
2527function checkRollover ( original : CalendarDay , modified : CalendarDay ) {
Original file line number Diff line number Diff line change @@ -208,7 +208,9 @@ export const isObject = (value: any): boolean => !!(value && value.toString() ==
208208 * @returns true if provided variable is Date
209209 * @hidden
210210 */
211- export const isDate = ( value : any ) : value is Date => value instanceof Date ;
211+ export const isDate = ( value : any ) : value is Date => {
212+ return Object . prototype . toString . call ( value ) === "[object Date]" ;
213+ }
212214
213215/**
214216 * Checks if the two passed arguments are equal
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ <h4 class="sample-title">Circular Avatars</h4>
1717
1818 < igx-avatar src ="https://images.unsplash.com/photo-1514041790697-53f1f86214d2?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=b7ac79503fbe78855a346c8d814f95ba&auto=format&fit=crop&w=1650&q=80 " size ="small " shape ="circle "> </ igx-avatar >
1919
20- < igx-avatar src ="assets/images/avatar/17 - Test .jpg " size ="medium " shape ="circle "> </ igx-avatar >
20+ < igx-avatar src ="assets/images/avatar/17.jpg " size ="medium " shape ="circle "> </ igx-avatar >
2121
2222 < igx-avatar src ="https://images.unsplash.com/photo-1506804880640-f3205deb1b8b?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=2f8dd0c16478825034602dce63d9aaca&auto=format&fit=crop&w=1350&q=80 " size ="large " shape ="circle "> </ igx-avatar >
2323 </ article >
@@ -41,7 +41,7 @@ <h4 class="sample-title">Rounded Avatars</h4>
4141
4242 < igx-avatar src ="https://images.unsplash.com/photo-1514041790697-53f1f86214d2?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=b7ac79503fbe78855a346c8d814f95ba&auto=format&fit=crop&w=1650&q=80 " size ="small " shape ="rounded "> </ igx-avatar >
4343
44- < igx-avatar src ="assets/images/avatar/17 - Test .jpg " size ="medium "
44+ < igx-avatar src ="assets/images/avatar/17.jpg " size ="medium "
4545 shape ="rounded "> </ igx-avatar >
4646
4747 < igx-avatar src ="https://images.unsplash.com/photo-1506804880640-f3205deb1b8b?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=2f8dd0c16478825034602dce63d9aaca&auto=format&fit=crop&w=1350&q=80 " size ="large " shape ="rounded "> </ igx-avatar >
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ <h4 class="sample-title">Checkbox sample</h4>
9191 < igx-list-item >
9292 < igx-avatar igxListThumbnail src ="assets/images/avatar/8.jpg "> </ igx-avatar >
9393 < span igxListLineTitle > Petar Vasilev</ span >
94- < igx-checkbox igxListAction [(ngModel)] ="user2.registered " [disableRipple] ="true "> Value</ igx-checkbox >
94+ < igx-checkbox class =" custom-checkbox " igxListAction [(ngModel)] ="user2.registered " [disableRipple] ="true "> Value</ igx-checkbox >
9595 </ igx-list-item >
9696
9797 < igx-list-item >
File renamed without changes.
You can’t perform that action at this time.
0 commit comments