Skip to content
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

Merged
merged 4 commits into from
Nov 10, 2016

Conversation

bradgearon
Copy link

added start and end query parameters to get events
resolves #1289

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 ";
Copy link
Contributor

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

Copy link
Author

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 💯

@DawoudIO
Copy link
Contributor

DawoudIO commented Nov 8, 2016

this looks like it is related to #1298 ... is there common code that we should use between them...

@DawoudIO DawoudIO added this to the 2.3.2 milestone Nov 8, 2016
@bradgearon
Copy link
Author

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
Copy link
Contributor

@DawoudIO DawoudIO left a 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']));
Copy link
Contributor

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

Copy link
Author

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 . '-' .
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix that

@crossan007 crossan007 modified the milestones: 2.3.3, 2.3.2 Nov 10, 2016
Copy link
Contributor

@DawoudIO DawoudIO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what changed here

@DawoudIO DawoudIO merged commit 0ba4915 into ChurchCRM:master Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some birthdays showing up on wrong date
3 participants