From 8055a9c80b00e2ed3a25faa328b51e8b25a5ce71 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 13 Aug 2012 11:18:15 -0400 Subject: [PATCH] CC-4214: Smart Playlist -> Criteria about datetime: Please convert the searched value from local time to UTC - fixed --- airtime_mvc/application/models/Block.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index cca9b63c5..bca194d20 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -1301,9 +1301,16 @@ EOT; foreach ($crit as $criteria) { $spCriteriaPhpName = self::$criteria2PeerMap[$criteria['criteria']]; $spCriteria = $criteria['criteria']; - $spCriteriaModifier = $criteria['modifier']; - $spCriteriaValue = $criteria['value']; + + $column = CcFilesPeer::getTableMap()->getColumnByPhpName(self::$criteria2PeerMap[$spCriteria]); + // if the column is timestamp, convert it into UTC + if ($column->getType() == PropelColumnTypes::TIMESTAMP) { + $spCriteriaValue = Application_Common_DateHelper::ConvertToUtcDateTimeString($criteria['value']); + } else { + $spCriteriaValue = $criteria['value']; + } + if ($spCriteriaModifier == "starts with") { $spCriteriaValue = "$spCriteriaValue%"; } else if ($spCriteriaModifier == "ends with") {