Giter Site home page Giter Site logo

dd-ui's People

Contributors

freeman14 avatar kobvel avatar nick-bogdanov avatar okolomiets avatar parxomchik avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kobvel theckman

dd-ui's Issues

Timestamp(-range) amendments on rendering time

Within STEW-234 I propose to fix <timestamp-range> component to have ability of dynamic render time (in hh:mma format) depending on what initial format is passed in via format attribute. Now it may render doubled time. See example:

{
    "start": "2016-10-21T17:00:00.002Z",
    "end": "2016-10-26T19:45:00.002Z",
    "tz": "America/Los_Angeles",
    "format": "ddd, MMM D, YYYY, hh:mma" <--- accidentally invalid format
}

<timestamps-range start="vm.start" end="vm.end" tz="vm.tz" format="vm.format"></timestamps-range>

Fri, Oct 21, 2016, 10:00am 10am – Wed, Oct 26, 2016, 12:45pm 12:45pm

The second time is a separated <timestamp> with the format 'hh:mma'. It allows us to handle 'the same date' case:
Fri, Oct 21, 2016 10am – 12:45pm (as per designed under EPF requirements).

Also, we need to handle 'the same month' case, currently not available.
So we could render the range as Dec 8–12, 2016.

<timestamps-range> not working with 'o.tz is not a function' exception

I've just noticed that <timestamps-range> normally implemented via dd-ui into both cms and apps manager is not working and throwing exception:

angular.js:13920 TypeError: i.tz is not a function
    at e.formatDate (http://localhost:8080/build.js?0b3961b8016c2acb407b:81644:789)
    at e.$onInit (http://localhost:8080/build.js?0b3961b8016c2acb407b:81644:518)
    at http://localhost:8080/build.js?0b3961b8016c2acb407b:9468:35
    at forEach (http://localhost:8080/build.js?0b3961b8016c2acb407b:502:19)
    at nodeLinkFn (http://localhost:8080/build.js?0b3961b8016c2acb407b:9457:10)
    at compositeLinkFn (http://localhost:8080/build.js?0b3961b8016c2acb407b:8793:14)
    at compositeLinkFn (http://localhost:8080/build.js?0b3961b8016c2acb407b:8796:14)
    at publicLinkFn (http://localhost:8080/build.js?0b3961b8016c2acb407b:8673:31)
    at lazyCompilation (http://localhost:8080/build.js?0b3961b8016c2acb407b:9017:26)
    at boundTranscludeFn (http://localhost:8080/build.js?0b3961b8016c2acb407b:8810:17)

Here is a sample of html code:

<timestamps-range start="'2016-10-21T17:00:00.002Z'" end="'2016-10-26T19:45:00.002Z'" tz="'America/Los_Angeles'" format="'ddd, MMM D, YYYY h:mma'"></timestamps-range>

<timestamp> component is working well as expected (using the same moment.js and moment-timezone.js).

Also, it's weird that there are no any errors in dd-ui Storybook and EPF (0.0.15 is still installed).
Any thoughts?

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.