Skip to content
This repository was archived by the owner on Jan 25, 2020. It is now read-only.

Commit 134d916

Browse files
committed
Merge?
1 parent a044e85 commit 134d916

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

app/Http/Controllers/API/ExecController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,15 +438,17 @@ public function deleteEvent(Request $request, Event $event)
438438

439439
public function generateCalendar(Request $request)
440440
{
441+
date_default_timezone_set('America/New_York');
441442
$vCalendar = new Calendar('www.boilermake.org');
442-
$events = Event::all();
443+
$events = Event::where('hidden', 0)->get();
443444
// Iterate through all events
444445
foreach ($events as $event) {
445446
$vEvent = new \Eluceo\iCal\Component\Event();
447+
$vEvent->setUseTimezone(true);
446448
$vEvent
447449
->setDtStart(new \DateTime($event->begin))
448450
->setDtEnd(new \DateTime($event->end))
449-
->setNoTime(true)
451+
->setNoTime(false)
450452
->setSummary($event->title);
451453
$vCalendar->addComponent($vEvent);
452454
}

app/Http/Controllers/API/GeneralController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static function resumeUrl($id, $method)
9292

9393
public function getEvents()
9494
{
95-
return Event::orderBy('begin')->get(['id', 'title', 'description', 'begin', 'end']);
95+
return Event::where('hidden', 0)->orderBy('begin')->get(['id', 'title', 'description', 'begin', 'end']);
9696
}
9797

9898
public function getAnnouncements()
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
use Illuminate\Database\Schema\Blueprint;
4+
use Illuminate\Database\Migrations\Migration;
5+
6+
class AddHiddenEventField extends Migration
7+
{
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::table('events', function (Blueprint $table) {
16+
$table->boolean('hidden')->default(false);
17+
});
18+
}
19+
20+
/**
21+
* Reverse the migrations.
22+
*
23+
* @return void
24+
*/
25+
public function down()
26+
{
27+
Schema::table('events', function (Blueprint $table) {
28+
$table->dropColumn('hidden');
29+
});
30+
}
31+
}

0 commit comments

Comments
 (0)