Giter Site home page Giter Site logo

dayjs / day.dart Goto Github PK

View Code? Open in Web Editor NEW
66.0 3.0 3.0 199 KB

⏰ Day.js in dart. Day.dart is inspired by Day.js. Write with nearly the same API. Build on the top of the powerful DateTime class.

Home Page: https://pub.dev/packages/day

License: MIT License

Dart 100.00%
dayjs datetime dart momentjs flutter

day.dart's Issues

How to escape format?

In dayjs you can do something like this:

dayjs('2019-01-25').format('[YYYYescape] YYYY-MM-DDTHH:mm:ssZ[Z]') 
// 'YYYYescape 2019-01-25T00:00:00-02:00Z'

Is it possible to escape some parts of the format string in this dart version too? Thanks!

question

this is sample string date

2021-02-04T02:00:40
I do

Day day = Day.fromString(activity.dateCreated);
      day.setHour(0);
      day.setMinute(0);
      day.setSecond(0);

print(day);
outputs 2021-02-04 02:00:40.000

The time is not 0. thoughts?

Wrong `.add()` behavior

With day.js, the following operation: dayjs('2020-08-31').add(1, 'month') outputs 2020-09-30, because it never exceeds the month's last day (if "month" is the unit), even if August has 31 days and September only 30.

In day.dart, the output of Day.fromString('2020-08-31').add(1, 'month') is 2020-10-01.

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.