code cleanup
This commit is contained in:
@@ -173,10 +173,11 @@ function _datearray_to_ts($date)
|
||||
date_default_timezone_set(date_default_timezone(FALSE));
|
||||
$tz = new DateTimeZone(date_default_timezone(FALSE));
|
||||
|
||||
if (empty($date) || ($date['month'] == '' && $date['day'] == '' && $date['year'] == ''))
|
||||
if (empty($date) || ($date['month'] == '' && $date['day'] == '' && $date['year'] == '')) {
|
||||
return 0;
|
||||
else
|
||||
watchdog('booking', "Date array to timestamp: @info", array('@info' => var_export($date, TRUE)));
|
||||
}
|
||||
//else
|
||||
// watchdog('booking', "Date array to timestamp: @info", array('@info' => var_export($date, TRUE)));
|
||||
|
||||
$gmt_ts = mktime(0, 0, 0, $date['month'], $date['day'], $date['year']);
|
||||
$ts = new DateTime("@$gmt_ts");
|
||||
@@ -192,8 +193,9 @@ function _datetime_array_to_ts($date)
|
||||
date_default_timezone_set(date_default_timezone(FALSE));
|
||||
$tz = new DateTimeZone(date_default_timezone(FALSE));
|
||||
|
||||
if (empty($date) || ($date['month'] == '' && $date['day'] == '' && $date['year'] == ''))
|
||||
if (empty($date) || ($date['month'] == '' && $date['day'] == '' && $date['year'] == '')) {
|
||||
return 0;
|
||||
}
|
||||
//else
|
||||
// watchdog('booking', "Date array to timestamp: @info", array('@info' => var_export($date, TRUE)));
|
||||
|
||||
@@ -211,16 +213,15 @@ function _date_to_ts($date) {
|
||||
date_default_timezone_set(date_default_timezone(FALSE));
|
||||
$tz = new DateTimeZone(date_default_timezone(FALSE));
|
||||
|
||||
if ($date_split[0] == '-1' )
|
||||
if ($date_split[0] == '-1' ) {
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
$gmt_ts = mktime(0, 0, 0, $date_split[2], $date_split[3], $date_split[1]);
|
||||
$ts = new DateTime("@$gmt_ts");
|
||||
$ts->setTimezone($tz);
|
||||
|
||||
return $ts->format("U");
|
||||
}
|
||||
//return mktime($date_split[5], $date_split[6], 0, $date_split[2], $date_split[3], $date_split[1]);
|
||||
}
|
||||
|
||||
@@ -232,14 +233,13 @@ function _datetime_to_ts($date) {
|
||||
|
||||
if ($date_split[0] == '-1' )
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
|
||||
$gmt_ts = mktime($date_split[5], $date_split[6], 0, $date_split[2], $date_split[3], $date_split[1]);
|
||||
$ts = new DateTime("@$gmt_ts");
|
||||
$ts->setTimezone($tz);
|
||||
|
||||
return $ts->format("U");
|
||||
}
|
||||
|
||||
//return mktime($date_split[5], $date_split[6], 0, $date_split[2], $date_split[3], $date_split[1]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user