Esempio n. 1
0
 public function dateLocales($a = null, $b = null, $c = null)
 {
     Toolset_DateParser::setDateLocaleStrings($a, $b, $c);
     return $this;
 }
 function wpv_filter_parse_date_get_resulting_date($date_value, $format)
 {
     $date_value = (string) $date_value;
     if (!$format && strpos($date_value, ',') !== false) {
         $date_parts = explode(',', $date_value);
         $ret = adodb_mktime(0, 0, 0, $date_parts[1], $date_parts[0], $date_parts[2]);
         return $ret;
     } else {
         // just in case the Parser is not loaded yet
         if (class_exists('Toolset_DateParser') === false) {
             require_once dirname(__FILE__) . "/expression-parser/parser.php";
         }
         $date_string = trim(trim(str_replace(',', '/', $date_value), "'"));
         $date = Toolset_DateParser::parseDate($date_string, $format);
         if (is_object($date) && method_exists($date, 'getTimestamp')) {
             $timestamp = $date->getTimestamp();
             // NOTE this timestamp construction should be compatible with the adodb_xxx functions
             return $timestamp;
         }
         return $date_value;
     }
 }