Comments (11)
yes ! please do! We were already planing to do this!
from date-time-format-timezone.
I may take a crack at this weekend, time permitting. It would presumably only work if the browser had an existing formatToParts
impl, i.e. it's only shimming the zone part of it. Is that what you were thinking too?
from date-time-format-timezone.
This was really easy to implement (see here) but when I went to test it, I realized it I couldn't find a platform where formatToParts()
is supported but zones are not. Besides the immediate issue of how to test it, it makes me wonder if this change is really necessary.
The one use case I found -- and how I tested my changes manually -- was to use Intl.js to polyfill formatToParts
and then use date-time-format-timezone
to add zone support to it. That does strike me as a real use case, but I have no idea how to integrate that into the testing framework here, nor how common the need for it is in practice. Is that useful?
If so, I need some guidance on how to configure the tests to test that. If not, I'll close this ticket. And if there's some use case or way forward I'm missing, I'd love to hear about it.
from date-time-format-timezone.
@icambron
Thanks for working on this.
Yes this polyfill not suppose to implement formatToParts on its own. But must be ready to passthrough formatToParts
if its supported by shimming timezone part of it.
this is only be possible in browsers which support Intl.DateTimeFormat
via intl.js polyfill.
Give me sometime so that I can add tests for such cases. Then you can add tests for formatToParts
and make and raise a Pull Request.
from date-time-format-timezone.
Give me sometime so that I can add tests for such cases
Meaning, you'll add the test infrastructure to run tests in an environment already polyfilled by Intl.js? If so, that sounds good.
from date-time-format-timezone.
@icambron yes
from date-time-format-timezone.
@icambron
Just added a test for ie10 in this Pull Request#12
since 1e10 , does not have support for intl it needs intl.js polyfill , this should be good test environment to formatToParts.
I have also added some test which should also test formatToParts implementation.
from date-time-format-timezone.
@icambron you can run ie10 on saucelabs,
these test do not run locally by default
use
grunt build karma:saucelabsTest
to run locally.
this assumes that you have process.env.SAUCE_USERNAME and process.env.SAUCE_ACCESS_KEY are set.
from date-time-format-timezone.
@markandey That makes sense and I'm happy to integrate my code with but I'm missing one thing: what's the best way for me to add the Intl.js pollyfill to the IE10 run of tests?
from date-time-format-timezone.
@icambron its all added now! (i have intl.js as npm)
after my PR you would see formatToParts tests which are skipped , you un cover them and TDD to add your implementation
from date-time-format-timezone.
OK, cool, thanks! I'll give it a shot and post a PR.
from date-time-format-timezone.
Related Issues (20)
- Include details about which browsers need this polyfill HOT 3
- formatToParts breaks in Chrome HOT 7
- formatToParts in Chrome HOT 1
- timeZoneName value is empty in PhantomJS HOT 1
- Symbol with code 8206 added after each date values in IE HOT 1
- formatToParts capability is not included in the last publish HOT 4
- unpkg cdn link currently broken HOT 1
- `grunt download` fails
- Formatting of timezone fails in IE11
- Object doesn't support property or method 'formatToParts' HOT 3
- Intl.DateTimeFormat.prototype.formatToParts called on incompatible receiver
- Invalid license specified HOT 1
- America/Punta_Arenas timezone is not supported, causes crash in IE11
- Inconsistent format - option weekday: 'long' between Intl.DateTimeFormat and toLocaleDateString
- Consider a more lightweight tz library HOT 1
- Australia Sydney is missing
- Error when getting "long" name for timeZone Etc/UTC
- ECMAScript Module Support
- Injection of locale data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from date-time-format-timezone.