mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Include the server timezone in iCal calendar export (closes #379)
This commit is contained in:
parent
53f0893f55
commit
04808eaa66
@ -5,6 +5,7 @@
|
||||
- When adding a product to the shopping list from the new context/more menu from the stock overview page and if the product is already on the shopping list, the amount of that entry will be updated acccordingly instead of adding a new (double) shopping list item
|
||||
- Fixed that the browser barcode scanner button was not clickable on iOS Safari (thanks @DeeeeLAN)
|
||||
- Fixed a problem regarding quantity unit conversion handling for recipe ingredients of products with no unit relations, but only a different purchase/stock quantity unit
|
||||
- Improved that dates in the iCal calendar export now includes the server timezone
|
||||
- The API Endpoint `GET /files/{group}/{fileName}` now also returns a `Cache-Control` header (defaults fixed to 30 days) to further increase page load times
|
||||
- Fixed that the API endpoint `/stock/shoppinglist/add-product` failed when a product should be added which was not already on the shopping list (thanks @Forceu)
|
||||
- Some style/CSS detail-refinements
|
||||
|
@ -26,12 +26,20 @@ class CalendarApiController extends BaseApiController
|
||||
$events = $this->CalendarService->GetEvents();
|
||||
foreach($events as $event)
|
||||
{
|
||||
$date = new \DateTime($event['start']);
|
||||
$date->setTimezone(date_default_timezone_get());
|
||||
|
||||
if ($event['date_format'] === 'date')
|
||||
{
|
||||
$date->setTime(23, 59, 59);
|
||||
}
|
||||
|
||||
$vEvent = new \Eluceo\iCal\Component\Event();
|
||||
$vEvent->setDtStart(new \DateTime($event['start']))
|
||||
->setDtEnd(new \DateTime($event['start']))
|
||||
$vEvent->setDtStart($date)
|
||||
->setDtEnd($date)
|
||||
->setSummary($event['title'])
|
||||
->setNoTime($event['date_format'] === 'date')
|
||||
->setUseUtc(false);
|
||||
->setUseTimezone(true);
|
||||
|
||||
$vCalendar->addComponent($vEvent);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user