Coder Social home page Coder Social logo

Comments (11)

markandey avatar markandey commented on May 21, 2024

yes ! please do! We were already planing to do this!

from date-time-format-timezone.

icambron avatar icambron commented on May 21, 2024

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.

icambron avatar icambron commented on May 21, 2024

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.

markandey avatar markandey commented on May 21, 2024

@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.

icambron avatar icambron commented on May 21, 2024

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.

markandey avatar markandey commented on May 21, 2024

@icambron yes

from date-time-format-timezone.

markandey avatar markandey commented on May 21, 2024

@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.

markandey avatar markandey commented on May 21, 2024

@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.

icambron avatar icambron commented on May 21, 2024

@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.

markandey avatar markandey commented on May 21, 2024

@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.

icambron avatar icambron commented on May 21, 2024

OK, cool, thanks! I'll give it a shot and post a PR.

from date-time-format-timezone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.