function testReverse_date_dd_mm_yyyy() { $test_date = "16-10-2011"; $reversed_date = DateTimeUtils::reverse_date_dd_mm_yyyy($test_date); $this->assertEqual("2011-10-16", $reversed_date, "La data non e' stata ribaltata correttamente!!"); $this->expectException("InvalidParameterException"); DateTimeUtils::reverse_date_dd_mm_yyyy("2012-10-02"); }
public static function updateResultFilters($peer) { $all_fields = $peer->__getAllFields(); foreach (Params::keys() as $key) { if (self::isFilter($key, Params::get($key))) { $value = Params::get($key); $filter_call = self::getFilterCall($key); if (self::isDateReversingEnabled()) { if ($all_fields[self::getFilterField($key)]["type"] == "date") { $value = DateTimeUtils::reverse_date_dd_mm_yyyy(Params::get($key)); } } $peer->{$filter_call}($value); } } }
function logicToRaw($logic_value) { return DateTimeUtils::reverse_date_dd_mm_yyyy($logic_value); }
public function setupWithMap($do, $params) { $all_fields = $this->__getAllFields(); foreach ($params as $key => $value) { $saved = false; if ($all_fields[$key]["type"] == "date") { $do->{$key} = DateTimeUtils::reverse_date_dd_mm_yyyy($value); $saved = true; } if (!$saved) { $do->{$key} = $value; } } return $do; }