For a tangible example of how this can work, look at the Voyager/VoyagerRestful drivers.  These use an internal VuFindDate object to convert dates and output appropriate strings.  Keeping the conversion inside the driver means that you don’t have to change any templates.

 

The VuFindDate format restrictions only apply if you are using PHP 5.2.x.  If you are using 5.3.x, you should be able to pass in arbitrary formats successfully.  If you are using 5.2.x, you can add some custom code to VuFindDate to process the date strings into a supported format.

 

- Demian

 

From: Christian Dabrowski [mailto:dabrowski.christian@fh-swf.de]
Sent: Thursday, October 04, 2012 10:08 AM
To: vufind-general@lists.sourceforge.net; vufind-tech
Subject: [VuFind-Tech] Date Format

 

Hi all,

sometime ago there was a question here in the list concerning date formats. Demain wrote that it is possible to use Vufinds date internal conversion. I found the place where it shall be converted (checkedout.tpl) do I have to call the function there or in the Aleph-Driver? And how can I do it?

I saw also in the VufindDate.php that the input formats are restricted to a few formats according to php requirements. The formats I would like to have converted are not listed there: "d/m/y" (04/10/2012) and "ymd" (20121004). Is there a chance to do use the internal date conversion anyway?

thanks in advance!

all best,

Christian