Code Search for Developers
 
 
  

Savant_Plugin_dateformat.php from Brim at Krugle


Show Savant_Plugin_dateformat.php syntax highlighted

<?php

/**
* 
* Output a formatted date using strftime() conventions.
* 
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
* 
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* 
* @author Paul M. Jones <pmjones@ciaweb.net>
* 
* @package Savant
* 
* @version $Id: Savant_Plugin_dateformat.php 13 2005-02-09 11:58:38Z barrel $
* 
* @access public
* 
* @param object &$savant A reference to the calling Savant object.
* 
* @param string $datestring Any date-time string suitable for
* strtotime().
* 
* @param string $format The strftime() formatting string.
* 
* @return string
* 
*/

require_once 'ext/Savant/Savant/Plugin.php';

class Savant_Plugin_dateformat extends Savant_Plugin {

	function dateformat(&$savant, $datestring, $format = '%d %b %Y')
	{
		if (trim($datestring != '')) {
			return strftime($format, strtotime($datestring));
		} else {
			return '';
		}
	}

}
?>




See more files for this project here

Brim

BRIM is a MVC framework, written in PHP and based on items with a hierarchical relationship. The list of plugins make BRIM a Information Manager with plugins like bookmarks, a calendar, contacts tasks, notes, RSS etc. The application is multilingual.

Project homepage: http://sourceforge.net/projects/brim
Programming language(s): JavaScript,PHP,SQL
License: other

  Savant_Plugin_ahref.php
  Savant_Plugin_checkbox.php
  Savant_Plugin_checkboxes.php
  Savant_Plugin_cycle.php
  Savant_Plugin_dateformat.php
  Savant_Plugin_image.php
  Savant_Plugin_input.php
  Savant_Plugin_javascript.php
  Savant_Plugin_modify.php
  Savant_Plugin_options.php
  Savant_Plugin_radios.php
  Savant_Plugin_stylesheet.php
  Savant_Plugin_textarea.php
  index.php