Giter Club home page Giter Club logo

property-mixins's Introduction

Published on NPM

API & Demo

property-mixins

helper mixins that extend elements to handle special data-properties

property-mixins's People

Contributors

fooloomanzoo avatar

Stargazers

 avatar

Watchers

 avatar  avatar

property-mixins's Issues

Request for License

Dear Fooloomanzoo,

Thank you so much for contributing these great packages to the community!
I was wondering if you could add the License file for property-mixins folder as well.

Sincerely,

Steven

Error when datetime is null

if datetime var on that line is null(wich in javascript is also an object typeof null == "object"), this throws an error because getData on the if statement dont exists on null

will summit pr with fix soon

if ((typeof datetime === 'object' && datetime.getDate) || !isNaN(+datetime)) {

datetime-mixin - date operations

In the datetime-mixin there is something like:

          ...
           if (isNaN(d)) {
            d = new Date();
          }
          d.setMilliseconds(milliseconds || 0);
          d.setSeconds(seconds || 0);
          d.setMinutes(minutes || 0);
          d.setHours(hours || 0);
          if (day !== undefined) {
            d.setDate(day);
          }
          if (month !== undefined) {
            d.setMonth(month - 1);
          }
          ...

Above calculations are not working as expected under iOS Chrome version 63.0.3239.132, eg:

If I want to set 2018-01-29 and today is 2018-02-05
first the date is initialized with new Date() to current date. After that the day part is updated to be equal 29 but due to Date nature d object is actually set to be 2018-03-01, and in the end the month part is set. The final value of d is equal 2018-01-01.

The fast fix is to change the order d.setMonth() and than d.setDay().

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.