worker-calendar
Version:
A customizable, responsive Angular calendar component for scheduling worker appointments or shifts
39 lines (33 loc) • 1.25 kB
text/typescript
/**
* Compatibility polyfill for Angular versions
* This file provides compatibility with Angular 14+ by ensuring methods and properties
* exist that might have been introduced in later versions of Angular.
*/
// Ivy compatibility
(window as any).__ivy = true;
// Ensure compatibility with Angular CDK
if (!(window as any).__NG_CDK_VERSION) {
(window as any).__NG_CDK_VERSION = { full: '14.0.0' };
}
// Provide compatibility for older Angular Material versions if used with this library
if (!(window as any).__NG_MATERIAL_VERSION) {
(window as any).__NG_MATERIAL_VERSION = { full: '14.0.0' };
}
// Function to check if Angular version is compatible
export function isCompatibleAngularVersion(version: string): boolean {
try {
const major = parseInt(version.split('.')[0]);
return major >= 14 && major < 17;
} catch (e) {
return false;
}
}
// Check for browser compatibility
export function checkBrowserCompatibility(): boolean {
const isModern = 'CSS' in window &&
'supports' in CSS &&
'requestAnimationFrame' in window &&
'matchMedia' in window &&
'customElements' in window;
return isModern;
}