Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date picker doesn't work in Safari #3

Open
fabiospada opened this issue Jan 23, 2015 · 10 comments
Open

Date picker doesn't work in Safari #3

fabiospada opened this issue Jan 23, 2015 · 10 comments

Comments

@fabiospada
Copy link

I find out that the problem is the lack of support of the Internationalization API in WebKit
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat#Browser_compatibility
that will cause an exception that prevent the whole page to load correctly

is there any workaround for this? or at least prevent the exception so that the rest of the page keep working

thank you

@David-Mulder
Copy link
Owner

First of all, are we talking about Safari on iOS or Safari on Mac here? And secondly of all, could you try including https://github.com/andyearnshaw/Intl.js and see whether that works, as I don't have access to either version of Safari (that's the problem with Safari in general, for a short while they had a cross platform version, but they killed it again in no time), but if it works I will add that as a default dependency.

@fabiospada
Copy link
Author

The problem is on both Safari for iOS and Safari for OS X.
I tried to use Intl.js but has some issues:

  • it doesn't use the default locale when it's not specified, instead use the first locale who loaded
  • it doesn't support every format options, eg. using { weekday: 'narrow' } does not appear the first letter of the weekday, instead appear the full date (see screenshot)

capture

I don't think this is the best solution, how about using Moment.js?

@David-Mulder
Copy link
Owner

Honestly, it's funny how safari has somehow taken over the place internet explorer used to have. Somehow nowadays it's always safari that lacks support for new standards.

Either way, I have two problems right now: 1) I live in a country where internet usage is limited and by mistake I downloaded a HUGE archive thus am now without internet till the end of the month. 2) I would greatly prefer this component not to rely on a full outside library (polyfills already feel like a compromise).

So, my current plan of action: Could you open an issue for Intl.js requesting for the missing output API's to be added? (It needs not be perfect as long as it's usable) If by next month they have been added or at least it looks like they will soon add it them then that's it (and I might try to polish up any rough edges, though that's quite hard with a locked and inaccessible browser like safari). If they claim adding such a thing is impossible I will see whether forking+a hack would do the trick and in the worst case I will switch to moment.js.

@fabiospada
Copy link
Author

The funny thing is that the webkit team have a ticket reported in 2012, but is still open
https://bugs.webkit.org/show_bug.cgi?id=90906

For Intl.js, instead, it's a know bug
andyearnshaw/Intl.js#75 (comment)
but it seems it will not be fixed to prevent the library gets too big

@suleymanccelik
Copy link

Can moment.js be used instead of intl.js for localization?
Moment.js : http://momentjs.com/

@suleymanccelik
Copy link

Is there any updates for this issue?

@fabiospada
Copy link
Author

If anyone is interested i made a fork, implemented moment.js and fixed some safari's bugs
https://github.com/fabiospada/paper-date-picker

@suleymanccelik
Copy link

@fabiospada thanks for your component. Your component is not responsive for small devices like android or ios phones.

@fabiospada
Copy link
Author

@suleymanccelik should be fixed now

@suleymanccelik
Copy link

@fabiospada thanks again for your component. Another issue is about position of dialog on safari.
The first time you open (toggle) the dialog .The dialog is recentered dynamically. But if you close and then reopen it, it'll keep the position it has when you've closed it and will never be recentered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants