mirror of
https://github.com/friendica/friendica
synced 2025-04-27 16:30:10 +00:00
Refactor datetime_convert into Temporal::convert
- Changed parameter order to save space - Refactor select_timezone into Temporal::getTimezoneSelect - Refactor field_timezone into Temporal::getTimezoneField
This commit is contained in:
parent
d478ef6c6d
commit
dc366bf1f7
62 changed files with 512 additions and 432 deletions
|
@ -8,6 +8,7 @@ use Friendica\Core\Addon;
|
|||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Util\Temporal;
|
||||
use dba;
|
||||
|
||||
require_once 'include/dba.php';
|
||||
|
@ -70,7 +71,7 @@ Class Cron {
|
|||
|
||||
// once daily run birthday_updates and then expire in background
|
||||
$d1 = Config::get('system', 'last_expire_day');
|
||||
$d2 = intval(datetime_convert('UTC', 'UTC', 'now', 'd'));
|
||||
$d2 = intval(Temporal::convert('now', 'UTC', 'UTC', 'd'));
|
||||
|
||||
if ($d2 != intval($d1)) {
|
||||
|
||||
|
@ -141,7 +142,7 @@ Class Cron {
|
|||
|
||||
Addon::reload();
|
||||
|
||||
$d = datetime_convert();
|
||||
$d = Temporal::convert();
|
||||
|
||||
// Only poll from those with suitable relationships,
|
||||
// and which have a polling address and ignore Diaspora since
|
||||
|
@ -217,33 +218,33 @@ Class Cron {
|
|||
*/
|
||||
switch ($contact['priority']) {
|
||||
case 5:
|
||||
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 month")) {
|
||||
if (Temporal::convert('now') > Temporal::convert($t . " + 1 month")) {
|
||||
$update = true;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 week")) {
|
||||
if (Temporal::convert('now') > Temporal::convert($t . " + 1 week")) {
|
||||
$update = true;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 day")) {
|
||||
if (Temporal::convert('now') > Temporal::convert($t . " + 1 day")) {
|
||||
$update = true;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 12 hour")) {
|
||||
if (Temporal::convert('now') > Temporal::convert($t . " + 12 hour")) {
|
||||
$update = true;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 hour")) {
|
||||
if (Temporal::convert('now') > Temporal::convert($t . " + 1 hour")) {
|
||||
$update = true;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + ".$min_poll_interval." minute")) {
|
||||
if (Temporal::convert('now') > Temporal::convert($t . " + ".$min_poll_interval." minute")) {
|
||||
$update = true;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue