Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow CarbonImmutable date #160

Merged
merged 1 commit into from
Jul 19, 2020

Conversation

mul14
Copy link
Contributor

@mul14 mul14 commented Jul 19, 2020

This pull request will allow to use Carbon or CarbonImmutable instance.

use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Spatie\GoogleCalendar\Event;

$event = new Event;

// Before: Only be able to assign Carbon instance.
$event->startDateTime = Carbon::now();

// After: Also be able to assign CarbonImmutable instance.
$event->startDateTime = CarbonImmutable::now();

This pull request will allow to use `Carbon` or `CarbonImmutable` instance.

```php
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Spatie\GoogleCalendar\Event;

$event = new Event;

// Before: Only be able to assign Carbon instance.
$event->startDateTime = Carbon::now();

// After: Also be able to assign CarbonImmutable instance.
$event->startDateTime = CarbonImmutable::now();
```
@freekmurze freekmurze merged commit 11abd17 into spatie:master Jul 19, 2020
@freekmurze
Copy link
Member

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants