chronos icon indicating copy to clipboard operation
chronos copied to clipboard

A standalone DateTime library originally based off of Carbon

Results 12 chronos issues
Sort by recently updated
recently updated
newest added

I am using PHPStan on my code. I am calling `->year` and `->month` on an object that is typehinted with `ChronosInterface` which is causing PHPStan to complain with the error...

documentation

Consider the following example of a future date two weeks ahead of today's date: `echo Chronos::parse(new DateTime('2 weeks'))->diffForHumans();` >1 week from now It seems to me the expected out put...

enhancement

``` php function doSomething(\Cake\Chronos\ChronosInterface $chronos) { return $chronos->year(2015); } ``` If a `Cake\Chronos\Chronos` object is given to the function returns a new `Cake\Chronos\Chronos` because this object is immutable If a...

enhancement

Since you've already added a Date class without time components, would it make sense to include a Time class without date components (or fixed to 0000-01-01) with included Timezone support?

enhancement

It would be useful if there was a way to handle DateInterval Roll-Over. For example, I would hope that `(ChronosInterval::seconds(107))->format('%I:%S')` would output `01:47` rather than `00:107`.

enhancement

`diffForHumans()` is returning "not very human" intervals for unit values. Per the discussion this tries to identify a standard and updates the values to match that. Fixes #307

> trigger_error( 'Since 2.4 ChronosInterval is deprecated. Use `Chronos::createInterval() instead.`', E_USER_DEPRECATED ); Why is that? The suggested method doesnt exist in the code I would recommend we keep this method...

question
RFC

If we construct a date at _midday, Tuesday_ with `new Chronos('Tue 12:0')`, but we are currently at 4pm tuesday, then this date will be 4 hours in the past. Let's...

enhancement

It seems [Chronos::setTestNow()](https://book.cakephp.org/chronos/3/en/index.html#testing-aids) only fixates the time and not the rest of a date, is that intended? For example, when using Chronos::createFromFormat() with a partial format, things like the day...

I just updated my installation of Chronos to the latest available version for the project (PHP 7.3, so best I get is 2.4.4), and I got this nonsensical error: `(new...

bug