GithubHelp home page GithubHelp logo

date_calc's Introduction

date_calc

Date manipulation library for easy calculating.

Usage

Installation

Add date_calc as a dependency in pubspec.yaml file.

dependencies:
  date_calc: ^0.1.0

Run pub install.

Using

import 'package:date_calc/date_calc.dart';

final date = DateCalc(2019, 1, 5);
print(date.addMonth(1));
// => 2019-02-05 00:00:00.000
print(date.addYear(1).isLeapYear());
// => true
print(date.addYear(1).addMonth(1).daysInMonth());
// => 29
print(date.dup(minute: 11));
// => 2019-01-05 00:11:00.000
print(date.differenceValue(date: DateTime(2019, 3, 3), type: DateType.month));
// => 1
print(DateCalc.now().isToday());
// => true

Because DateCalc is a subclass of DateTime, you can use all DateTime methods.
When you need exactly DateTime object, use toDate() method.

final date = DateCalc(2019, 1, 5);
date.subtractYear(1).toDate();

milestones for 1.0.0

  • support for DST
  • support for UTC & Timezone
  • support for leapsecond

date_calc's People

Contributors

makicamel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

date_calc's Issues

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.