Coder Social home page Coder Social logo

cp-date-fns's Introduction

The implementation of JavaScript Library date-fns by using PHP

Copy from date-fns

Installation

We can simply add the package into our project by using Composer to run the command below:

composer require a2htray/cp-date-fns:dev-master

Table of methods

Method Description
Utils::addYears Return the date added serveral years
Utils::addQuarters Return the date add several quarters
Utils::addMonths Return the date add several months
Utils::addDays Return the date add several days
Utils::addHours Return the date add several hours
Utils::addMinutes Return the date add several minutes
Utils::addSeconds Return the date add serveral seconds
Utils::addMilliseconds Return the date add serveral milliseconds
Utils::closeIndexTo Return an index of the closest date from the array comparing to the given date
Utils::compareAsc Compare two dates return 1ใ€-1 or 0
Utils::compareDesc Compare two dates return 1ใ€-1 or 0
Utils::differenceInDays Get the number of full days between two given dates
Utils::differenceInHours Get the number of hours between two given dates
Utils::differenceInCalendarDays Get the number of calendar days between two given dates
Utils::differenceInCalendarMonths Get the number of calendar months between two given dates
Utils::differenceInCalendarQuarters Get the number of calendar quarters between two given dates
Utils::differenceInCalendarYears Get the number of calendar years between two given dates
Utils::getQuarter Return the order of the given date in current year
Utils::getMilliseconds Return the milliseconds of the given date
Utils::startOfDay Get the start date of the given date
Utils::subDays Subtract serveral days form the given date, then return the date after subtraction
Utils::subHours Subtract serveral hours form the given date, then return the date after subtraction
Utils::endOfDay Get the end date of the given date
Utils::endOfDecade Get the date which is the end date of current decade of the given date
Utils::endOfHour Get the date which is the end date of current hour of the given date
Utils::endOfMonth Get the date which is the end date of current month of the given date
Utils::endOfMinute Get the date which is the end date of current minute of the given date
Utils::endOfSecond Get the date which is the end date of current second of the given date
Utils::endOfWeek Get the date which is the end date of current week of the given date
Utils::endOfYear Get the date which is the end date of current year of the given date
Utils::endOfQuarter Get the date which is the end date of current quarter of the given date
Utils::isMonday Whether is Monday
Utils::isTuesday Whether is Tuesday
Utils::isWednesday Whether is Wednesday
Utils::isThursday Whether is Thursday
Utils::isFriday Whether is Friday
Utils::isSaturday Whether is Saturday
Utils::isSunday Whether is Sunday
Utils::isSameDay Whether is same between two given dates
Utils::isFirstDayOfMonth Whether is the first day of the month
Utils::isLastDayOfMonth Whether is the last day of the month

cp-date-fns's People

Contributors

a2htray avatar

Watchers

 avatar  avatar

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.