mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-10-08 16:02:58 +00:00
added composer.json and needed libs
This commit is contained in:
parent
4f1fb007c5
commit
1f74d409a2
42 changed files with 4413 additions and 0 deletions
65
curweather/vendor/cmfcmf/openweathermap-php-api/Cmfcmf/OpenWeatherMap/Util/Time.php
vendored
Normal file
65
curweather/vendor/cmfcmf/openweathermap-php-api/Cmfcmf/OpenWeatherMap/Util/Time.php
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
/**
|
||||
* OpenWeatherMap-PHP-API — A php api to parse weather data from http://www.OpenWeatherMap.org .
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* Please see the LICENSE file distributed with this source code for further
|
||||
* information regarding copyright and licensing.
|
||||
*
|
||||
* Please visit the following links to read about the usage policies and the license of
|
||||
* OpenWeatherMap before using this class:
|
||||
*
|
||||
* @see http://www.OpenWeatherMap.org
|
||||
* @see http://www.OpenWeatherMap.org/terms
|
||||
* @see http://openweathermap.org/appid
|
||||
*/
|
||||
|
||||
namespace Cmfcmf\OpenWeatherMap\Util;
|
||||
|
||||
/**
|
||||
* The time class representing a time object.
|
||||
*/
|
||||
class Time
|
||||
{
|
||||
/**
|
||||
* @var \DateTime The start time for the forecast.
|
||||
*/
|
||||
public $from;
|
||||
|
||||
/**
|
||||
* @var \DateTime The end time for the forecast.
|
||||
*/
|
||||
public $to;
|
||||
|
||||
/**
|
||||
* @var \DateTime The day of the forecast.
|
||||
*/
|
||||
public $day;
|
||||
|
||||
/**
|
||||
* Create a new time object.
|
||||
*
|
||||
* @param string|\DateTime $from The start time for the forecast.
|
||||
* @param string|\DateTime $to The end time for the forecast.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function __construct($from, $to = null)
|
||||
{
|
||||
if (isset($to)) {
|
||||
$from = ($from instanceof \DateTime) ? $from : new \DateTime((string)$from);
|
||||
$to = ($to instanceof \DateTime) ? $to : new \DateTime((string)$to);
|
||||
$day = new \DateTime($from->format('Y-m-d'));
|
||||
} else {
|
||||
$from = ($from instanceof \DateTime) ? $from : new \DateTime((string)$from);
|
||||
$day = clone $from;
|
||||
$to = clone $from;
|
||||
$to = $to->add(new \DateInterval('PT23H59M59S'));
|
||||
}
|
||||
|
||||
$this->from = $from;
|
||||
$this->to = $to;
|
||||
$this->day = $day;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue