mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-08-11 11:18:47 +08:00
adjust demos to work with PHP 5.2 or higher
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
//
|
||||
// An optional "timezone" GET parameter will force all ISO8601 date stings to a given timezone.
|
||||
//
|
||||
// Requires PHP 5.3.0 or higher.
|
||||
// Requires PHP 5.2.0 or higher.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
// Require our Event class and datetime utilities
|
||||
require __DIR__ . '/utils.php';
|
||||
require dirname(__FILE__) . '/utils.php';
|
||||
|
||||
// Short-circuit if the client did not give us a date range.
|
||||
if (!isset($_GET['start']) || !isset($_GET['end'])) {
|
||||
@@ -30,7 +30,7 @@ if (isset($_GET['timezone'])) {
|
||||
}
|
||||
|
||||
// Read and parse our events JSON file into an array of event data arrays.
|
||||
$json = file_get_contents(__DIR__ . '/../json/events.json');
|
||||
$json = file_get_contents(dirname(__FILE__) . '/../json/events.json');
|
||||
$input_arrays = json_decode($json, true);
|
||||
|
||||
// Accumulate an output array of event data arrays.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
// This script outputs a JSON array of all timezones (like "America/Chicago") that PHP supports.
|
||||
//
|
||||
// Requires PHP 5.3.0 or higher.
|
||||
// Requires PHP 5.2.0 or higher.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
echo json_encode(DateTimeZone::listIdentifiers());
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
// Utilities for our event-fetching scripts.
|
||||
//
|
||||
// Requires PHP 5.3.0 or higher.
|
||||
// Requires PHP 5.2.0 or higher.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
// PHP will fatal error if we attempt to use the DateTime class without this being set.
|
||||
@@ -111,7 +111,7 @@ class Event {
|
||||
function parseDateTime($string, $timezone=null) {
|
||||
$date = new DateTime(
|
||||
$string,
|
||||
$timezone ?: new DateTimeZone('UTC')
|
||||
$timezone ? $timezone : new DateTimeZone('UTC')
|
||||
// Used only when the string is ambiguous.
|
||||
// Ignored if string has a timezone offset in it.
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user