All Projects → thephpleague → Period

thephpleague / Period

Licence: mit
PHP's time range API

Projects that are alternatives of or similar to Period

Laydate
layDate(日期与时间组件) 是 layui 独立维护的三大组件之一
Stars: ✭ 1,066 (+73.05%)
Mutual labels:  time, date, datetime, calendar
Tail.datetime
A lightweight, translat- and configurable Open Source DateTime Picker, written in pure vanilla JavaScript!
Stars: ✭ 139 (-77.44%)
Mutual labels:  time, date, datetime, calendar
Vue Ctk Date Time Picker
VueJS component to select dates & time, including a range mode
Stars: ✭ 707 (+14.77%)
Mutual labels:  time, date, calendar, range
nepali-datetime
Python's core datetime inspired nepali datetime (BS date & NPT) package 🇳🇵
Stars: ✭ 36 (-94.16%)
Mutual labels:  time, datetime, date, calendar
React Datetime Picker
A datetime picker for your React app.
Stars: ✭ 294 (-52.27%)
Mutual labels:  time, date, datetime, calendar
Time
Building a better date/time library for Swift
Stars: ✭ 1,983 (+221.92%)
Mutual labels:  time, date, datetime, calendar
Calendar
📅 PHP Date & Time library that solves common problems in object oriented, immutable way.
Stars: ✭ 113 (-81.66%)
Mutual labels:  time, date, datetime, calendar
shamsi date
A Flutter and Dart package for using Jalali (Shamsi, Solar, Persian or Jalaali) calendar. You can convert, format and manipulate Jalali and Gregorian (Miladi) date and times.
Stars: ✭ 59 (-90.42%)
Mutual labels:  time, datetime, date, calendar
Dpicker
A framework-agnostic minimal date picker
Stars: ✭ 187 (-69.64%)
Mutual labels:  time, date, datetime, calendar
Date
A date and time library based on the C++11/14/17 <chrono> header
Stars: ✭ 2,389 (+287.82%)
Mutual labels:  time, date, datetime, calendar
Iso8601
Ruby parser to work with ISO8601 dateTimes and durations — http://en.wikipedia.org/wiki/ISO_8601
Stars: ✭ 70 (-88.64%)
Mutual labels:  interval, time, date, datetime
Angular Moment Picker
Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
Stars: ✭ 536 (-12.99%)
Mutual labels:  time, date, datetime, calendar
dayjs
Extended fork of Day.js - 2KB immutable date library alternative to Moment.js
Stars: ✭ 36 (-94.16%)
Mutual labels:  time, datetime, date
Human Interval
Human readable time distances for javascript
Stars: ✭ 360 (-41.56%)
Mutual labels:  interval, time, date
Zebra datepicker
A super-lightweight, highly configurable, cross-browser date / time picker jQuery plugin
Stars: ✭ 367 (-40.42%)
Mutual labels:  date, datetime, calendar
vue-timeselector
🕒 Simply customizable powerful time picker for Vue.js
Stars: ✭ 41 (-93.34%)
Mutual labels:  time, datetime, date
date-php
这是一个Javascript模仿PHP日期时间格式化函数,使用方法和PHP非常类似,有丰富的模板字符,并在原来的基础上增加了一些模板字符。 This is a date function that implement PHP in Javascript. It is very similar to PHP, has rich template characters, and enhances some template characters on the basis of the original.
Stars: ✭ 24 (-96.1%)
Mutual labels:  time, datetime, date
Carbon
A simple, semantic and developer-friendly golang package for datetime
Stars: ✭ 565 (-8.28%)
Mutual labels:  time, date, datetime
React Daterange Picker
A date range picker for your React app.
Stars: ✭ 259 (-57.95%)
Mutual labels:  date, calendar, daterange
React Infinite Calendar
✨ Infinite scrolling date-picker built with React, with localization, range selection, themes, keyboard support, and more.
Stars: ✭ 3,828 (+521.43%)
Mutual labels:  date, calendar, range

Period

Author Latest Version Software License Build Infection MSI Total Downloads

Period is PHP's missing time range API. Based on ideas from Resolving Feature Envy in the Domain by Mathias Verraes, this package extends the concept to cover all basic operations regarding time ranges.

Highlights

  • Represents Interval, Datepoint, Duration and Collection as value objects
  • Exposes named constructors to ease object creation
  • Covers all basic manipulations related to time range
  • Enables working with simple or complex time ranges logic
  • Fully documented
  • Framework-agnostic

Documentation

Full documentation can be found at period.thephpleague.com.

System Requirements

You need PHP >= 7.2.0 but the latest stable version of PHP is recommended.

Install

Install Period using Composer.

$ composer require league/period

or download the library and:

  • use any other PSR-4 compatible autoloader.
  • use the bundle autoloader script as shown below:
require 'path/to/period/repo/autoload.php';

use League\Period\Datepoint;

Datepoint::create('2012-05-23')->getDay()->getDateInterval();
//returns new DateInterval('P1D');

where path/to/period/repo represents the path where the library was extracted.

Testing

Period has:

To run the tests, run the following command from the project folder.

$ composer test

Contributing

Contributions are welcome and will be fully credited. Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].