Angular-calendar: Calendar not working on iOS platform

Created on 17 Jul 2017  路  5Comments  路  Source: mattlewis92/angular-calendar

Hi,
I am developing a hybrid application, and using this plugin which works perfectly on android platform.However I am getting the following error on iOS platform which I am not able to figure it out.

[Error] EXCEPTION: Error in ./CalendarMonthViewComponent class CalendarMonthViewComponent - inline template:3:67 caused by: Invalid regular expression: unmatched parentheses handleError (main.js:93805) next (main.js:63231:94) (anonymous function) (main.js:65287) __tryOrUnsub (main.js:18365) next (main.js:18314) _next (main.js:18267) next (main.js:18231) next (main.js:18031) emit (main.js:65273) triggerError (main.js:47029) onHandleError (main.js:46990) handleError (polyfills.js:3:9767) runTask (polyfills.js:3:7703) invoke (polyfills.js:3:11405) dispatchEvent handleTapPolyfill (main.js:122001) pointerEnd (main.js:121887) (anonymous function) handleTouchEnd (main.js:186498) (anonymous function) [Error] ORIGINAL EXCEPTION: Invalid regular expression: unmatched parentheses handleError (main.js:93807) next (main.js:63231:94) (anonymous function) (main.js:65287) __tryOrUnsub (main.js:18365) next (main.js:18314) _next (main.js:18267) next (main.js:18231) next (main.js:18031) emit (main.js:65273) triggerError (main.js:47029) onHandleError (main.js:46990) handleError (polyfills.js:3:9767) runTask (polyfills.js:3:7703) invoke (polyfills.js:3:11405) dispatchEvent handleTapPolyfill (main.js:122001) pointerEnd (main.js:121887) (anonymous function) handleTouchEnd (main.js:186498) (anonymous function)

Thanks

Most helpful comment

You need to call Intl.__disableRegExpRestore() somewhere in your codebase (probably straight after import 'intl';)

All 5 comments

The issue is with the intl polyfill, not this lib: https://github.com/andyearnshaw/Intl.js/issues/231

tl;dr call Intl.__disableRegExpRestore()

Sorry for my inexperience in this topic, but I am not able to understand how to solve my issue and make this plugin work on iOS platform. Unfortunatley I am not able to decode any solution from the link given by you. Can you please provide me more details on what should I do.
In safari when debugging error is

Error: Error in ./CalendarMonthViewComponent class CalendarMonthViewComponent - inline template:3:67 caused by: Invalid regular expression: unmatched parentheses main.js

Thank you.

You need to call Intl.__disableRegExpRestore() somewhere in your codebase (probably straight after import 'intl';)

to fix with Angular simply

$ npm install intl --save-dev

and add in the top of your ./src/app.module.ts

// import Intl to fix angular Date Pipe with Safari & IOS
import 'intl';
import 'intl/locale-data/jsonp/en';

You need to call Intl.__disableRegExpRestore() somewhere in your codebase (probably straight after import 'intl';)

Sorry for my inexperience, but, how I can do this?

If I put this on app.module.ts:

import 'intl';
import 'intl/locale-data/jsonp/en';
Intl.__disableRegExpRestore();

show me this error: Property '__disableRegExpRestore' does not exist on type 'typeof Intl'.

Thanks in advanced for your help!

Was this page helpful?
0 / 5 - 0 ratings