-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed range calculation and query in CalendarService #1295
Conversation
added start and end query parameters to get events resolves ChurchCRM#1289
@@ -80,7 +80,10 @@ | |||
|
|||
/// top of main form | |||
// | |||
$sSQL = "SELECT DISTINCT event_types.* FROM event_types RIGHT JOIN events_event ON event_types.type_id=events_event.event_type ORDER BY type_id "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please ensure you idea uses the editor config settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I added line breaks manually cause it was hard to read all on one line, yes I have the editor config enabled 💯
this looks like it is related to #1298 ... is there common code that we should use between them... |
the changes in #1298 don't have any common code, because the birth day is stored in three fields in the database |
…1289 # Conflicts: # src/Service/CalendarService.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good just need more info about the start and end date
@@ -5,7 +5,8 @@ | |||
$app->group('/calendar', function () { | |||
|
|||
$this->get('/events', function ($request, $response, $args) { | |||
return $response->withJson($this->CalendarService->getEvents()); | |||
$params = $request->getQueryParams(); | |||
return $response->withJson($this->CalendarService->getEvents($params['start'], $params['end'])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are the start and end date come from
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they come from the fullcalendar plugin
$start = $year . "-" . $person->getBirthMonth() . "-" . $person->getBirthDay(); | ||
$event = $this->createCalendarItem("birthday", $person->getFullName(), $start, "", $person->getViewURI()); | ||
|
||
$start = date_create($year . '-' . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let us try not to add extra breaks as it makes it hard to read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what changed here
added start and end query parameters to get events
resolves #1289