GithubHelp home page GithubHelp logo

noahlam / miment Goto Github PK

View Code? Open in Web Editor NEW
336.0 336.0 31.0 153 KB

a fast,light weight,simple and non-dependencies datetime library for javascript ( mini moment )

License: MIT License

JavaScript 100.00%

miment's People

Contributors

doodlewind avatar ll5 avatar noahlam avatar sidkwok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

miment's Issues

Lint support

We can add standard style linting, adding it to Travis config.

distance API design

For now the distance method returns a Miment object, which produces confusing result without extra args formatting. Is this behavior by design or can be optimized?

I can think of some alternatives:

  • Make distance also "computed" methods, returning formatted timestamp or date field, instead of Miment object. In this case we can't add offset to a date distance unless parsing it again.
  • Add specific props in Miment instance marking whether it stands for distance, then workaround it on formatting. e.g, we can format distance instance into milliseconds by default, instead of raw Date.toString. I'm not sure about side effects of this approach.

See also difference API in Moment.js.

isBetween API

Determine if the current datetime is between two other datetimes

我在IE10中使用miment遇到了问题

报错如下:[Vue warn]: Error in v-on handler: "TypeError: 对象不支持“format”属性或方法",

个人感觉是IE不支持高级语法,所以我在main.js中使用了babel-polyfill进行转换,但是依旧出现上述问题,不知道怎么解决。

升级到 0.06 后报错

执行 npm run dev 后提示

This dependency was not found:

  • miment in ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"/Users/zaxlct1/Desktop/vvv/tracker/pc/node_modules/.cache/cache-loader"}!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?
    type=script&index=0!./src/components/OrderCard.vue, ../public/directive.js

Unit test support

Hi, this library is what I seek for long as an alternative to moment! For now I can see some points that can be improved and I'm interested in implementing some. While for now it's not that "assured" to make any change since the missing of tests. How about adding some cases covering main API? For further changes this can be a good start.

I'm willing to provide PR if it's acceptable.

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.