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 formatting plans? #23

Open
nocive opened this issue Oct 19, 2015 · 5 comments
Open

Date formatting plans? #23

nocive opened this issue Oct 19, 2015 · 5 comments

Comments

@nocive
Copy link

nocive commented Oct 19, 2015

First of all, thanks for all the hard work put into this, really useful for myself and my team.
This is not really an issue report but more of a question.

Do you guys have any estimation/plans regarding introducing date formats support?
Thanks

@bojanz
Copy link
Contributor

bojanz commented Oct 19, 2015

Unfortunately all plans for date support have been dropped, due to other parts of the library (as well as the addressing library) taking more time than expected.
I need to remove the "Coming soon" from the README.

I'd be happy to review any PRs or external libraries trying to tackle the issue.

@nocive
Copy link
Author

nocive commented Oct 19, 2015

Alright, thanks for the quick update :)
We'd be happy to tackle that, do you have any rough drafts of what the top level API would look like?

@bojanz
Copy link
Contributor

bojanz commented Oct 19, 2015

Our NumberFormatter API resembles the one provided by the intl extension, with improvements made where it made sense.

We should attempt the same for the DateFormatter. Here's the intl extension one: http://php.net/manual/en/intldateformatter.create.php

The formatter would need to receive a DateFormat object, which would include the available date formats and replacements per calendar. See https://github.com/andyearnshaw/Intl.js/blob/master/locale-data/json/en.json for an example.
If that turns out to be too much to load at once we can break out the calendars into separate files.

@joshmiller83
Copy link

Like a fanboy, I just want to say @nocive is getting my hopes up! Very exciting that we're going to see some movement on the date formatters! Personally, I'm just fascinated with the fact that there are other calendars in the world.

@ndf
Copy link

ndf commented Dec 9, 2015

In early 2015 I tried to make a quite complete mapping to convert CLDR to PHP datetime.
https://github.com/ndf/CLDR-2-PHP-converter

Would like to put some energy in an initial PR!
@bojanz Can you provide some guidance what code i should mimic/folow?

Notes
The CLDR datetime 'language' cannot be fully translated in the PHP datetime object. CLDR contains more information, like 'era' and more templates for days of the week. (T and Tu for Tuesday)

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

4 participants