function get_snowrss_scheduled_close_date ($date_format = 'j F Y, g:i a') {
		$data = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_SNOWRSS, 'scheduledCloseDate');
		if (! empty($data[0]['data']) ) {
			$parser = SimplePie_Parse_Date::get();
			$date_parsed = $parser->parse($data[0]['data']);
		}
		else {
			$date_parsed = null;
		}
		if ($date_parsed) {
			$date_format = (string) $date_format;
			switch ($date_format)
			{
				case '':
					return $this->sanitize($date_parsed, SIMPLEPIE_CONSTRUCT_TEXT);

				case 'U':
					return $date_parsed;

				default:
					return date($date_format, $date_parsed);
			}
		}
		else {
			return null;
		}
	}
Esempio n. 2
0
 public function get_date($date_format = 'j F Y, g:i a')
 {
     if (!isset($this->data['date'])) {
         if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date')) {
             $this->data['date']['raw'] = $return[0]['data'];
         }
         if (!empty($this->data['date']['raw'])) {
             $parser = SimplePie_Parse_Date::get();
             $this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']);
         } else {
             $this->data['date'] = null;
         }
     }
     if ($this->data['date']) {
         $date_format = (string) $date_format;
         switch ($date_format) {
             case '':
                 return $this->sanitize($this->data['date']['raw'], SIMPLEPIE_CONSTRUCT_TEXT);
             case 'U':
                 return $this->data['date']['parsed'];
             default:
                 return date($date_format, $this->data['date']['parsed']);
         }
     } else {
         return null;
     }
 }
Esempio n. 3
0
 public static function parse_date($dt)
 {
     $parser = SimplePie_Parse_Date::get();
     return $parser->parse($dt);
 }