{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic/issues/7538","repository_url":"https://api.github.com/repos/driftyco/ionic","labels_url":"https://api.github.com/repos/driftyco/ionic/issues/7538/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic/issues/7538/comments","events_url":"https://api.github.com/repos/driftyco/ionic/issues/7538/events","html_url":"https://github.com/driftyco/ionic/issues/7538","id":169320749,"number":7538,"title":"IOS Date Pipes JSON cyclic structure Error.","user":{"login":"simpss","id":6879043,"avatar_url":"https://avatars.githubusercontent.com/u/6879043?v=3","gravatar_id":"","url":"https://api.github.com/users/simpss","html_url":"https://github.com/simpss","followers_url":"https://api.github.com/users/simpss/followers","following_url":"https://api.github.com/users/simpss/following{/other_user}","gists_url":"https://api.github.com/users/simpss/gists{/gist_id}","starred_url":"https://api.github.com/users/simpss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simpss/subscriptions","organizations_url":"https://api.github.com/users/simpss/orgs","repos_url":"https://api.github.com/users/simpss/repos","events_url":"https://api.github.com/users/simpss/events{/privacy}","received_events_url":"https://api.github.com/users/simpss/received_events","type":"User","site_admin":false},"labels":[{"id":296092591,"url":"https://api.github.com/repos/driftyco/ionic/labels/platform:android","name":"platform:android","color":"009800","default":false},{"id":296092548,"url":"https://api.github.com/repos/driftyco/ionic/labels/platform:ios","name":"platform:ios","color":"0052cc","default":false},{"id":311009737,"url":"https://api.github.com/repos/driftyco/ionic/labels/v2","name":"v2","color":"313744","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-04T08:37:33Z","updated_at":"2016-11-29T18:46:01Z","closed_at":"2016-08-04T20:18:59Z","body":"#### Short description of the problem:\n\nCannot use Date Pipes on IOS. Works as expected on android.\n\nI know that the fix might have to go to the angular2 repo, but thought it best to start the discussion here as it only affects the IOS builds.\n#### What behavior are you expecting?\n\nWhen using the angular date pipe `{{date | date: 'yyyy-MM-dd'}}` I would expect the date to show up in a `yyyy-MM-dd` format.\n#### What is happening?\n\nWhen using the angular Date Pipe `{{date | date: 'yyyy-MM-dd'}}` on IOS There is a JSON parsing error.\n`ERROR: error JSON.stringify()ing argument: TypeError: JSON.stringify cannot serialize cyclic structures.`\n\n**Steps to reproduce:**\n1. Clone the example app: https://github.com/simpss/ionic2-date-pipe\n2. Build for IOS. (instructions in repository readme)\n3. Deploy to an IOS device/emulator.\n4. Click `Set Date`\n5. Click `Show Piped Date`\n6. Look at the xcode error console to see the error:\n\n```\nERROR: error JSON.stringify()ing argument: TypeError: JSON.stringify cannot serialize cyclic structures.\n```\n\n**Other information:** (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)\n The code itself is simple. It's just creating a new date with `this.date = new Date();` and then tries to display it with `{{date | date: 'yyyy-MM-dd'}}`\n\n**Which Ionic Version?** \n**2.0.0-beta.18**\n\n**Run `ionic info` from terminal/cmd prompt:** (paste output below)\n\n```\n$ ionic info\nYour system information:\nCordova CLI: 6.2.0\nIonic Framework Version: 2.0.0-beta.10\nIonic CLI Version: 2.0.0-beta.32\nIonic App Lib Version: 2.0.0-beta.18\nios-deploy version: 1.8.6 \nios-sim version: Not installed\nOS: Mac OS X El Capitan\nNode Version: v4.4.7\nXcode version: Xcode 7.3.1 Build version 7D1014\n```\n"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic/issues/comments/263660384","html_url":"https://github.com/driftyco/ionic/issues/7538#issuecomment-263660384","issue_url":"https://api.github.com/repos/driftyco/ionic/issues/7538","id":263660384,"user":{"login":"lincolnthree","id":362329,"avatar_url":"https://avatars.githubusercontent.com/u/362329?v=3","gravatar_id":"","url":"https://api.github.com/users/lincolnthree","html_url":"https://github.com/lincolnthree","followers_url":"https://api.github.com/users/lincolnthree/followers","following_url":"https://api.github.com/users/lincolnthree/following{/other_user}","gists_url":"https://api.github.com/users/lincolnthree/gists{/gist_id}","starred_url":"https://api.github.com/users/lincolnthree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lincolnthree/subscriptions","organizations_url":"https://api.github.com/users/lincolnthree/orgs","repos_url":"https://api.github.com/users/lincolnthree/repos","events_url":"https://api.github.com/users/lincolnthree/events{/privacy}","received_events_url":"https://api.github.com/users/lincolnthree/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T18:46:01Z","updated_at":"2016-11-29T18:46:01Z","body":"I believe in newer versions of ionic, you can simply add these scripts to your polyfills.ts file:\r\n\r\n### Add as dependency:\r\n\r\n`npm install intl --save`\r\n\r\n### src/polyfills.ts\r\n```\r\n// This file includes polyfills needed by Angular 2 and is loaded before\r\n// the app. You can add your own extra polyfills to this file.\r\nimport 'core-js/es6/symbol';\r\nimport 'core-js/es6/object';\r\nimport 'core-js/es6/function';\r\nimport 'core-js/es6/parse-int';\r\nimport 'core-js/es6/parse-float';\r\nimport 'core-js/es6/number';\r\nimport 'core-js/es6/math';\r\nimport 'core-js/es6/string';\r\nimport 'core-js/es6/date';\r\nimport 'core-js/es6/array';\r\nimport 'core-js/es6/regexp';\r\nimport 'core-js/es6/map';\r\nimport 'core-js/es6/set';\r\nimport 'core-js/es6/reflect';\r\n\r\nimport 'core-js/es7/reflect';\r\nimport 'zone.js/dist/zone';\r\n\r\nimport 'intl/dist/Intl.min.js';\r\nimport 'intl/locale-data/complete.js;\r\n```"}}
{"actor":{"display_login":"lincolnthree"}}