Skip to content

Commit

Permalink
Forced calendar on date field.
Browse files Browse the repository at this point in the history
  • Loading branch information
peavers committed Apr 8, 2015
1 parent 8accd09 commit ca30736
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
5 changes: 4 additions & 1 deletion _config/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
name: full-calendar
---
---
DateField:
default_config:
showcalendar: true
9 changes: 4 additions & 5 deletions code/pagetypes/FullCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ public function getCMSFields()
DropdownField::create('ColumnFormat', 'Column format')
->setDescription("Determines the text that will be displayed on the calendar's column headings.")
->setSource(array(
'ddd' => 'Mon, Tues, Wed',
'ddd' => 'Mon, Tues, Wed',
'ddd M/D' => 'Mon 9/7, Tues 9/8, Wed 9/9',
'dddd' => 'Monday, Tuesday, Wednesday'
'dddd' => 'Monday, Tuesday, Wednesday'
)),
UploadField::create('LoadAnimation', 'Loading animation')
->setFolderName(FullCalendarConst::UPLOAD_PREFIX)
Expand Down Expand Up @@ -138,7 +138,6 @@ public function init()
));

Requirements::set_combined_files_folder(ASSETS_DIR . '/_combinedfiles/calendar-module');

}

/**
Expand Down Expand Up @@ -195,12 +194,12 @@ public function getData()
{
if ($this->LegacyEvents) {
$filter = array(
'ParentID' => $this->ID,
'ParentID' => $this->ID,
'IncludeOnCalendar' => true,
);
} else {
$filter = array(
'ParentID' => $this->ID,
'ParentID' => $this->ID,
'IncludeOnCalendar' => true,
'EndDate:GreaterThan' => date("Y-m-d")
);
Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"email": "[email protected]"
}
],
"require": {
"silverstripe/framework": ">=3.1.0",
"silverstripe/cms": ">=3.1.0"
},
"extra": {
"screenshots": [
"images/screens/calendar.png",
Expand Down
6 changes: 6 additions & 0 deletions templates/Layout/FullCalendar.ss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
$Title

<h1>$getDocumentRoot.Link</h1>

$Content

<div class="document-overlay">
<% if $LoadAnimation %>
$LoadAnimation
Expand Down

0 comments on commit ca30736

Please sign in to comment.