{"id":33990516,"url":"https://github.com/n0rthernl1ghts/oop-moment-php","last_synced_at":"2026-05-27T18:03:27.574Z","repository":{"id":57028491,"uuid":"112468151","full_name":"N0rthernL1ghts/oop-moment-php","owner":"N0rthernL1ghts","description":"Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js","archived":false,"fork":false,"pushed_at":"2022-09-08T18:17:19.000Z","size":387,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-14T18:18:22.454Z","etag":null,"topics":["datetime","localization","moment","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/N0rthernL1ghts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-29T11:39:05.000Z","updated_at":"2022-09-08T18:17:24.000Z","dependencies_parsed_at":"2022-08-23T16:20:28.103Z","dependency_job_id":null,"html_url":"https://github.com/N0rthernL1ghts/oop-moment-php","commit_stats":null,"previous_names":[],"tags_count":93,"template":false,"template_full_name":null,"purl":"pkg:github/N0rthernL1ghts/oop-moment-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N0rthernL1ghts%2Foop-moment-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N0rthernL1ghts%2Foop-moment-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N0rthernL1ghts%2Foop-moment-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N0rthernL1ghts%2Foop-moment-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/N0rthernL1ghts","download_url":"https://codeload.github.com/N0rthernL1ghts/oop-moment-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N0rthernL1ghts%2Foop-moment-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33577637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datetime","localization","moment","php"],"created_at":"2025-12-13T06:16:30.607Z","updated_at":"2026-05-27T18:03:27.567Z","avatar_url":"https://github.com/N0rthernL1ghts.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpre\u003e\n                                      _           _           \n _ __ ___   ___  _ __ ___   ___ _ __ | |_   _ __ | |__  _ __  \n| '_ ` _ \\ / _ \\| '_ ` _ \\ / _ \\ '_ \\| __| | '_ \\| '_ \\| '_ \\\n| | | | | | (_) | | | | | |  __/ | | | |_ _| |_) | | | | |_) |\n|_| |_| |_|\\___/|_| |_| |_|\\___|_| |_|\\__(_) .__/|_| |_| .__/\n                                           |_|         |_|    \n\u003c/pre\u003e\n\n[![Build Status](https://travis-ci.org/fightbulc/moment.php.svg?branch=master)](https://travis-ci.org/fightbulc/moment.php)\n[![Total Downloads](https://img.shields.io/packagist/dt/fightbulc/moment.svg?style=flat-square)](https://packagist.org/packages/fightbulc/moment)\n\n[Change log](#changelog)\n\n# Intro\n\n### Note\nThis version is fork of fightbulc/moment.php and serves just temporary purpose until changes are accepted by maintainer.\n\n### What is moment.php?\n\nDate library for parsing, manipulating and formatting dates w/ i18n.\n\n### Any dependencies?\n\nPHP 5.4 or later since moment.php is based on php's [DateTime Class](http://php.net/manual/en/class.datetime.php).\n\n-------------------------------------------------\n\n# Install\n\nEasy install via composer. Still no idea what composer is? Inform yourself [here](http://getcomposer.org).\n\n```bash\ncomposer require northern-lights/moment\n```\n\nOr manually adding to composer.json:\n```json\n{\n    \"require\": {\n        \"northern-lights/moment\": \"*\"\n    }\n}\n```\n\n-------------------------------------------------\n\n# Quick examples\n\n### Get a moment\n\n```php\n$m = new \\Moment\\Moment(); // default is \"now\" UTC\necho $m-\u003eformat(); // e.g. 2012-10-03T10:00:00+0000\n\n$m = new \\Moment\\Moment('now', 'Europe/Berlin');\necho $m-\u003eformat(); // e.g. 2012-10-03T12:00:00+0200\n\n$m = new \\Moment\\Moment('2017-06-06T10:00:00', 'Europe/Berlin');\necho $m-\u003eformat(); // e.g. 2012-10-03T12:00:00+0200\n\n$m = new \\Moment\\Moment(1499366585);\necho $m-\u003eformat(); // e.g. 2017-07-06T18:43:05+0000\n```\n\n-------------------------------------------------\n\n### Accepted date formats\n\nMoment parses the following date formats as input:\n\n```php\nconst ATOM = 'Y-m-d\\TH:i:sP'; // 2005-08-15T15:52:01+00:00\nconst COOKIE = 'l, d-M-y H:i:s T'; // Monday, 15-Aug-2005 15:52:01 UTC\nconst ISO8601 = 'Y-m-d\\TH:i:sO'; // 2005-08-15T15:52:01+0000\nconst RFC822 = 'D, d M y H:i:s O'; // Mon, 15 Aug 05 15:52:01 +0000\nconst RFC850 = 'l, d-M-y H:i:s T'; // Monday, 15-Aug-05 15:52:01 UTC\nconst RFC1036 = 'D, d M y H:i:s O'; // Mon, 15 Aug 05 15:52:01 +0000\nconst RFC1123 = 'D, d M Y H:i:s O'; // Mon, 15 Aug 2005 15:52:01 +0000\nconst RFC2822 = 'D, d M Y H:i:s O'; // Mon, 15 Aug 2005 15:52:01 +0000\nconst RSS = 'D, d M Y H:i:s O'; // Mon, 15 Aug 2005 15:52:01 +0000\nconst W3C = 'Y-m-d\\TH:i:sP'; // 2005-08-15T15:52:01+00:00\n\n// Moment also tries to parse dates without timezone or without seconds\n\nconst NO_TZ_MYSQL = 'Y-m-d H:i:s'; // 2005-08-15 15:52:01\nconst NO_TZ_NO_SECS = 'Y-m-d H:i'; // 2005-08-15 15:52\nconst NO_TIME = 'Y-m-d'; // 2005-08-15\n\n// time fractions \".000\" will be automatically removed\n$timeWithFraction = '2016-05-04T10:00:00.000';\n```\n\n-------------------------------------------------\n\n### Switch locale\n\nHave a look at the ```Locales``` folder to see all supported languages. Default locale is ```en_GB```.\n\n```php\n$m = new \\Moment\\Moment();\necho $m-\u003eformat('[Weekday:] l'); // e.g. Weekday: Wednesday\n\n// set german locale\n\\Moment\\Moment::setLocale('de_DE');\n\n$m = new \\Moment\\Moment();\necho $m-\u003eformat('[Wochentag:] l'); // e.g. Wochentag: Mittwoch\n```\n\nAnother way to set locale in OOP fashion (dependency injection):\n```php\n// set Norwegian locale - at this very moment, few locales are supported for this way\n\\Moment\\Moment::setLocale(new \\Moment\\Locales\\no_NB());\n\n// You can also override locale definitions on the fly:\n\\Moment\\Moment::setLocale(new \\Moment\\Locales\\no_NB([\n    'relativeTime' =\u003e [\n        'future' =\u003e 'in %s'\n    ]\n]));\n\n(...)\n```\n\n__Supported languages so far:__\n\n```ar_TN``` Arabic (Tunisia)  \n```ca_ES``` Catalan  \n```zh_CN``` Chinese  \n```zh_TW``` Chinese (traditional)  \n```cs_CZ``` Czech  \n```da_DK``` Danish  \n```nl_NL``` Dutch  \n```en_GB``` English (British)  \n```en_US``` English (American)  \n```fr_FR``` French (Europe)  \n```de_DE``` German (Germany)  \n```hu_HU``` Hungarian    \n```in_ID``` Indonesian  \n```it_IT``` Italian  \n```ja_JP``` Japanese  \n```oc_LNC``` Lengadocian    \n```pl_PL``` Polish  \n```pt_BR``` Portuguese (Brazil)  \n```pt_PT``` Portuguese (Portugal)  \n```ru_RU``` Russian (Basic version)  \n```es_ES``` Spanish (Europe)  \n```se_SV``` Swedish  \n```no_NB``` Norwegian\n```uk_UA``` Ukrainian  \n```th_TH``` Thai  \n```tr_TR``` Turkish  \n```vi_VN``` Vietnamese  \n\n-------------------------------------------------\n\n### Switch timezones\n\n```php\n$m = new \\Moment\\Moment('2012-04-25T03:00:00', 'CET');\necho $m-\u003esetTimezone('UTC')-\u003eformat(); // 2012-04-25T01:00:00+0000\n```\n\n#### Change default timezone\n\n```php\n\\Moment\\Moment::setDefaultTimezone('CET');\n\n$m = new \\Moment\\Moment('2016-09-13T14:32:06');\necho $m-\u003eformat(); // 2016-09-13T14:32:06+0100\n```\n\n\n-------------------------------------------------\n\n### Custom format\n\n#### I. PHP only (Standard)\n\n```php\n$m = new \\Moment\\Moment('2012-04-25T03:00:00', 'CET');\necho $m-\u003eformat('l, dS F Y / H:i (e)'); // Wednesday, 25th April 2012 / 03:00 (Europe/Berlin)\n```\nFormats are based on PHP's [Date function](http://php.net/manual/en/function.date.php) and [DateTime class](http://www.php.net/manual/en/datetime.formats.php).\n\n#### II. Non-php formats\n\nYou can now inject different format handling by passing along a class which implements the ```FormatsInterface```. You can find an example within the test folder for implementing all formats from [moment.js](http://momentjs.com/docs/#/displaying/format/). Thanks to [Ashish](https://github.com/ashishtilara) for taking the time to match ```moment.js``` formats to those of PHP. Have a look at the [test script](https://github.com/fightbulc/moment.php/blob/master/test/test.php) to see the example in action.\n\nEverybody can write format classes in the same manner. Its easy and scalable.\n\n```php\n// get  desired formats class\n// create a moment\n$m = new \\Moment\\Moment('2012-04-25T03:00:00', 'CET');\n\n// format with moment.js definitions\necho $m-\u003eformat('LLLL', new \\Moment\\CustomFormats\\MomentJs()); // Wednesday, April 25th 2012 3:00 AM\n```\n\n`Custom formats` can also come as part of every `Locale`. If it does not exist for your locale yet go ahead and add it. See an example for the [French locale](https://github.com/fightbulc/moment.php/blob/master/src/Locales/fr_FR.php). \n\n#### III. Easy text escaping\n\nJust wrap all your text within ```[]``` and all characters will be automatically escaped for you.\n\n```php\n$m = new \\Moment\\Moment('2012-04-25T03:00:00', 'CET');\necho $m-\u003eformat('[We are in the month of:] F'); // We are in the month of: April\n```\n\n#### IV. Fixed ordinal representations\n\nPHP's interal ordinal calculation seems to be buggy. I added a quick fix to handle this issue.\n\nThe following example prints the week of the year of the given date. It should print ```22nd```:\n\n```php\n// internal function\ndate('WS', mktime(12, 22, 0, 5, 27, 2014)); // 22th\n\n// moment.php\n$m = new \\Moment\\Moment('2014-05-27T12:22:00', 'CET');\n$m-\u003eformat('WS'); // 22nd\n```\n\n-------------------------------------------------\n\n### Create custom moments and manipulate it\n\n#### I. Past/Future moments\n\n```php\n$m = new \\Moment\\Moment('2012-05-15T12:30:00', 'CET');\necho $m-\u003eaddHours(2)-\u003eformat(); // 2012-05-15T14:30:00+0200\n\n$m = new \\Moment\\Moment('2012-05-15T12:30:00', 'CET');\necho $m-\u003esubtractDays(7)-\u003esubtractMinutes(15)-\u003eformat(); // 2012-05-08T12:15:00+0200\n\n$m = new \\Moment\\Moment('@1401443979', 'CET'); // unix time\necho $m-\u003esubtractDays(7)-\u003esubtractMinutes(15)-\u003eformat(); // 2014-05-23T09:44:39+0000\n```\n\n#### II. Clone a given moment\n\nSometimes its useful to take a given moment and work with it without changing the origin. For that use ```cloning()```.\n\n```php\n$m = new \\Moment\\Moment('2012-05-15T12:30:00', 'CET');\n$c = $m-\u003ecloning()-\u003eaddDays(1);\n\necho $m-\u003egetDay(); // 15\necho $c-\u003egetDay(); // 16\n```\n\nAlternately, you can enable immutable mode on the origin.\n\n```php\n$m = new \\Moment\\Moment('2012-05-15T12:30:00', 'CET', true);\n$c = $m-\u003eaddDays(1);\n\necho $m-\u003egetDay(); // 15\necho $c-\u003egetDay(); // 16\n\n// You can also change the immutable mode after creation:\n$m-\u003esetImmutableMode(false)-\u003esubtractDays(1);\n\necho $m-\u003egetDay(); // 14\n```\n\nImmutable mode makes all modification methods call `cloning()` implicitly before applying their modifications.\n\n#### III. Methods for manipulating the date/time\n\nAdd             | Subtract\n---             | ---\naddSeconds($s)  | subtractSeconds($s)\naddMinutes($i)  | subtractMinutes($i)\naddHours($h)    | subtractHours($h)\naddDays($d)     | subtractDays($d)\naddWeeks($w)    | subtractWeeks($w)\naddMonths($m)   | subtractMonths($m)\naddYears($y)    | subtractYears($y)\n\n#### IV. Setter/Getter\n\nSetter          | Getter\n---             | ---\nsetSecond($s)   | getSecond()\nsetMinute($m)   | getMinute()\nsetHour($h)     | getHour()\nsetDay($d)      | getDay()\nsetMonth($m)    | getMonth()\nsetYear($y)     | getYear()\n--              | getQuarter()\n\n-------------------------------------------------\n\n### Difference between dates\n\n```php\n$m = new \\Moment\\Moment('2013-02-01T07:00:00');\n$momentFromVo = $m-\u003efromNow();\n\n// or from a specific moment\n$m = new \\Moment\\Moment('2013-02-01T07:00:00');\n$momentFromVo = $m-\u003efrom('2011-09-25T10:00:00');\n\n// result comes as a value object class\necho $momentFromVo-\u003egetDirection()  // \"future\"\necho $momentFromVo-\u003egetSeconds()    // -42411600\necho $momentFromVo-\u003egetMinutes()    // -706860\necho $momentFromVo-\u003egetHours()      // -11781\necho $momentFromVo-\u003egetDays()       // -490.88\necho $momentFromVo-\u003egetWeeks()      // -70.13\necho $momentFromVo-\u003egetMonths()     // -17.53\necho $momentFromVo-\u003egetYears()      // -1.42\necho $momentFromVo-\u003egetRelative()   // in a year\n```\n\n-------------------------------------------------\n\n### Get date periods (week, month, quarter)\n\nSometimes its helpful to get the period boundaries of a given date. For instance in case that today is Wednesday and I need the starting-/end dates from today's week. Allowed periods are ```week```, ```month``` and ```quarter```.\n\n```php\n$m = new \\Moment\\Moment('2013-10-23T10:00:00');\n$momentPeriodVo = $m-\u003egetPeriod('week');\n\n// results comes as well as a value object class\necho $momentPeriodVo\n    -\u003egetStartDate()\n    -\u003eformat('Y-m-d'); // 2013-10-21\n\necho $momentPeriodVo\n    -\u003egetEndDate()\n    -\u003eformat('Y-m-d'); // 2013-10-27\n\necho $momentPeriodVo\n    -\u003egetRefDate()\n    -\u003eformat('Y-m-d'); // 2013-10-23\n\necho $momentPeriodVo-\u003egetInterval(); // 43 = week of year\n```\n\nSame procedure for monthly and quarterly periods:\n\n```php\n$momentPeriodVo = $m-\u003egetPeriod('month');\n$momentPeriodVo = $m-\u003egetPeriod('quarter');\n```\n\n-------------------------------------------------\n\n### Calendar Times\n\nCalendar time displays time relative to ```now```, but slightly differently than ```Moment::fromNow()```. ```Moment::calendar()``` will format a date with different strings depending on how close to today the date is.\n\n```php\n(new \\Moment\\Moment('2014-03-30T16:58:00', 'CET'))-\u003esubtractDays(6)-\u003ecalendar(); // last week\n(new \\Moment\\Moment('2014-03-30T16:58:00', 'CET'))-\u003esubtractDays(1)-\u003ecalendar(); // yesterday\n(new \\Moment\\Moment('2014-03-30T16:58:00', 'CET'))-\u003ecalendar(); // today\n(new \\Moment\\Moment('2014-03-30T16:58:00', 'CET'))-\u003eaddDays(1)-\u003ecalendar(); // tomorrow\n(new \\Moment\\Moment('2014-03-30T16:58:00', 'CET'))-\u003eaddDays(3)-\u003ecalendar(); // next week\n(new \\Moment\\Moment('2014-03-30T16:58:00', 'CET'))-\u003eaddDays(10)-\u003ecalendar(); // everything else\n```\n\nTime            | Display\n---             | ---\nLast week       | Last Monday at 15:54\nThe day before  | Yesterday at 15:54\nThe same day    | Today at 15:54\nThe next day    | Tomorrow at 15:54\nThe next week   | Wednesday at 15:54\nEverything else | 04/09/2014\n\n__Note:__ Use ```$moment-\u003ecalendar(false)``` to leave out the time ```at 00:00```.\n\n-------------------------------------------------\n\n### startOf / endOf\n\nSame process as for moment.js: mutates the original moment by setting it to the start/end of a unit of time.\n\n```php\n$m = new \\Moment\\Moment('20140515T10:15:23', 'CET');\n\n$m-\u003estartOf('year');    // set to January 1st, 00:00 this year\n$m-\u003estartOf('quarter');  // set to the beginning of the current quarter, 1st day of months, 00:00\n$m-\u003estartOf('month');   // set to the first of this month, 00:00\n$m-\u003estartOf('week');    // set to the first day of this week, 00:00\n$m-\u003estartOf('day');     // set to 00:00 today\n$m-\u003estartOf('hour');    // set to now, but with 0 mins, 0 secs\n$m-\u003estartOf('minute');  // set to now, but with 0 seconds\n\n$m-\u003eendOf('year');    // set to December 31st, 23:59 this year\n$m-\u003eendOf('quarter');  // set to the end of the current quarter, last day of month, 23:59\n$m-\u003eendOf('month');   // set to the last of this month, 23:59\n$m-\u003eendOf('week');    // set to the last day of this week, 23:59\n$m-\u003eendOf('day');     // set to 23:59 today\n$m-\u003eendOf('hour');    // set to now, but with 59 mins, 59 secs\n$m-\u003eendOf('minute');  // set to now, but with 59 seconds\n```\n\n__Note:__ I ignored the period of ```second``` since we are not dealing with milliseconds.\n\n-------------------------------------------------\n\n### Get dates for given weekdays for upcoming weeks\n\nFor one of my customers I needed to get moments by selected weekdays. __The task was:__ give me the dates for\n```Tuesdays``` and ```Thursdays``` for the next three weeks. So I added a small handler which does exactly this.\nAs result you will receive an array filled with ```Moment Objects```.\n\n```php\n// 1 - 7 = Mon - Sun\n$weekdayNumbers = [\n    2, // tuesday\n    4, // thursday\n];\n\n$m = new \\Moment\\Moment();\n$dates = $m-\u003egetMomentsByWeekdays($weekdayNumbers, 3);\n\n// $dates = [Moment, Moment, Moment ...]\n```\n\nYou can now run through the result and put it formatted into a drop-down field or for whatever you might need it.\n\n-------------------------------------------------\n\n# Roadmap\n\n- Try to port useful methods from moment.js\n- Add unit tests\n\n-------------------------------------------------\n\n# Changelog\n\n### 2.0.0\n - fixed:\n    - en_GB OOP\n    - sv_SE OOP\n    - pt_BR OOP\n    - pt_PT OOP\n    - fr_FR\n - other:\n    - Locales uses new array syntax, therefore killing \u003c PHP5.4 support (PHP5.3)\n\n### 1.27.0\n - added:\n    - OOP way of setting locale (dependency injection)\n      - Allows shipping locales in separate composer modules\n      - Allows overriding definitions of locale on the fly\n    - Norwegian locale (no_NB)\n\n### 1.26.10\n - fixed:\n    - Occitan locale\n\n### 1.26.9\n - fixed:\n    - Russian locale [issue](https://github.com/fightbulc/moment.php/issues/68#issuecomment-264890181)\n\n### 1.26.8\n - added:\n    - Portuguese (pt_PT)\n\n### 1.26.7\n - fixed:\n    - Hungarian locale weekdays order\n\n### 1.26.6\n - added:\n    - allow initialising Moment with unix timestamp without leading @\n\n### 1.26.5\n - fixed:\n    - Fix format of 'LLL' in Custom Formats\n\n### 1.26.4\n - fixed:\n    - removed php5.4+ only syntax\n\n### 1.26.3\n - fixed:\n    - Danish day- and monthnames correct case\n    - French locale\n    - PHPDocs\n  - added:\n    - consts for `NO_TZ_MYSQL`, `NO_TZ_NO_SECS` and `NO_TIME` when parsing dates\n    \n### 1.26.2\n - added:\n    - Dutch customFormat\n\n### 1.26.1\n - fixed:\n    - Russian locale\n\n### 1.26.0\n - added:\n    - Turkish locale  \n - fixed:\n    - Lengadocian locale\n\n### 1.25.1\n - fixed:\n    - PHP7.1 setTime requires `$microseconds`  \n\n### 1.25\n - added:\n    - Ukrainian locale  \n\n### 1.24\n - added:\n    - Hungarian locale  \n\n### 1.23.1\n - fixed:\n    - Lengadocian locale  \n\n### 1.23.0\n - added:\n    - Vietnamese locale\n    - Lengadocian locale  \n\n### 1.22.0\n - added:\n    - Change default timezone\n- fixed:\n    - FormatsInterface docs\n    \n### 1.21.0\n - added:\n    - Arabic locale\n    - Custom format on locale level\n\n### 1.20.9\n - fixed:\n    - Russian locale\n - added:\n    - Russian locale tests\n\n### 1.20.8\n - fixed:\n    - Polish locale\n    - Calculation of seconds\n    \n### 1.20.7\n- fixed:\n    - Russian: more relative time fixes\n\n### 1.20.6\n- fixed:\n    - Russian locale relative time: day handling\n\n### 1.20.5\n- fixed:\n    - missing immutable handling\n\n### 1.20.4\n- fixed:\n    - Improved Polish locale (added Nominativ)\n\n### 1.20.3\n- fixed:\n    - Chinese locale\n\n### 1.20.2\n- added accepted formats to README\n\n### 1.20.1\n- fixed:\n    - Thai locale\n\n### 1.20.0\n- added:\n    - Catalan locale\n- fixed:\n    - Polish locale test\n\n### 1.19.0\n- added:\n    - Russian locale\n- fixed:\n    - Polish locale test\n\n### 1.18.0\n- added:\n    - Immutable mode\n- fixed:\n    - Polish locale\n\n### 1.17.0\n- added:\n    - Polish locale\n\n### 1.16.0\n- added:\n    - Indonesian locale\n\n### 1.15.0\n- added:\n    - Japanese locale\n\n### 1.14.1\n- fixed:\n    - typo in Dutch locale\n\n### 1.14.0\n- added:\n    - Dutch locale\n\n### 1.13.0\n- added:\n    - Swedish locale\n\n### 1.12.0\n- added:\n    - Danish locale\n\n### 1.11.4\n- fixed:\n    - fixed starting/ending weekday for Romanian locale\n\n### 1.11.3\n- fixed:\n    - adding delimiter character to Italian locale\n\n### 1.11.1\n- fixed:\n    - passing back new instance for startOf/endOf for week, month, quarter\n\n### 1.11.0\n- added:\n    - locale Czech\n\n### 1.10.4\n- added:\n    - ```calendar``` locale receives as \\Closure the following params ```function(Moment $m) {}```\n    - ```relativeTime``` locale receives as \\Closure the following params ```function($count, $direction, Moment $m) {}```\n\n### 1.10.3\n- added:\n    - fixed passing closures to locale (calendar, relativeTime)\n    - set correct german locale information\n\n### 1.10.2\n- added:\n    - fixed Thai locale strings\n\n### 1.10.1\n- added:\n    - locale traditional Chinese\n\n### 1.10.0\n- added:\n    - locale Chinese\n    - ordinal formatter receives now the ```token``` e.g. the token within ```dS``` is ```d```  \n\n### 1.9.1\n- fixed: english ordinal issue for numbers between 11 - 13\n\n### 1.9.0\n- added: locale Italian\n\n### 1.8.1\n- fixed: english ordinal issue\n\n### 1.8.0\n- added: locale Portuguese\n\n### 1.7.2\n- fixed:\n    - Locale displayed wrong month name (#34)\n    - Changed the order of weekdays within locale files\n\n### 1.7.1\n- added:\n    - getWeekdayNameLong()\n    - getWeekdayNameShort()\n    - getMonthNameLong()\n    - getMonthNameShort()\n\n### 1.7.0\n- added:\n    - Locale: Thai\n\n### 1.6.0\n- added:\n    - Locale\n    - MomentFromVo:\n        - getMonths()\n        - getYears()\n        - getRelative()\n- fixed:\n    - MomentFromVo:\n        - getSeconds() shows now direction as well\n\n### 1.5.3\n- fixed:\n    - timezone issue which occured only for unixtime dates\n- other:\n    - MomentFromVo:\n        - direction returns now: \"future\" (-) / \"past\" (+)\n        - time values are now type casted as floats\n\n### 1.5.2\n- fixed:\n    - unrecognised timezone when constructing a Moment\n\n### 1.5.1\n- added:\n    - getMomentsByWeekdays()\n    - getWeekday()\n    - getWeekOfYear()\n- other:\n    - escaped text\n\n### 1.5.0\n- added:\n    - startOf and endOf as implemented by [moment.js](http://momentjs.com/docs/#/manipulating/start-of/)\n    - get the quarter period of a given date\n    - setDay()\n    - getDay()\n    - setMonth()\n    - getMonth()\n    - setYear()\n    - getYear()\n    - getQuarter()\n    - setSecond()\n    - getSecond()\n    - setMinute()\n    - getMinute()\n    - setHour()\n    - getHour()\n    - added cloning()\n        - create a new mutable moment based of the given instance\n    - added ```getInterval()``` to ```MomentPeriodVo``` to indicate the interval of the given period\n        - ```week``` = week of the year\n        - ```month``` = month of the year\n        - ```quarter``` = quarter of the year\n    - added a static class ```MomentHelper```\n        - get the period for a given quarter in a given year\n    - fixed PHP's internal ordinal calculation (also in combination with moment.js formatting)\n        - e.g. ```WS``` for 21th week of the year shows now correct ```21th``` etc.\n    - you can now escape text by wrapping it in ```[]```\n        - e.g. ```[Hello World]``` will be automatically transformed into ```\\H\\e\\l\\l\\o \\W\\o\\r\\l\\d```\n\n- removed:\n    - add()\n    - subtract()\n\n### 1.4.0\n- added:\n    - calendar format as implemented by [moment.js](http://momentjs.com/docs/#/displaying/calendar-time/)\n\n### 1.3.0\n- fixed:\n    - incompatibility w/ PHP 5.3\n\n- added:\n    - Exception throw as ```MomentException```\n    - Date validation on instantiation:\n        - test for dates w/ format ```YYYY-mm-dd``` and ```YYYY-mm-ddTHH:ii:ss```\n        - throws MomentException on invalid dates\n    - addSeconds()\n    - addMinutes()\n    - addHours()\n    - addDays()\n    - addWeeks()\n    - addMonths()\n    - addYears()\n    - subtractSeconds()\n    - subtractMinutes()\n    - subtractHours()\n    - subtractDays()\n    - subtractWeeks()\n    - subtractMonths()\n    - subtractYears()\n\n- deprecated:\n    - add()\n    - subtract()\n\n-------------------------------------------------\n\n# License\nMoment.php is freely distributable under the terms of the MIT license.\n\nCopyright (c) 2017 Tino Ehrich\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn0rthernl1ghts%2Foop-moment-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn0rthernl1ghts%2Foop-moment-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn0rthernl1ghts%2Foop-moment-php/lists"}