New Date().toLocaleString(); causes the Expo app to crash

Hi Guys,

if I try to run new Date().toLocaleString(); in Expo (I am using the newest SDK) the Expo app crashes.
Here is a Snack that shows the behaviour:

I’ve used this method before without any issues. Please tell me what I am doing wrong there :slight_smile:

1 Like

just tried on my latest version expo client app and it worked fine. On latest iOS

This is a known issue on Android with SDK 22. As a quick fix (depending on your use case) you can either do:

  1. Date.toLocaleString = Date.toString
  2. Implement Date.toLocaleString yourself by using a library like date-fns or moment.

We are tracking this issue upstream here: (please click Subscribe on that issue instead of commenting “+1” unless you have something helpful to contribute).