XML and Keyword Modifiers


(Ian Hirst) #1

We import xml files (news items) into our matrix system using a script. When the asset is created in the system, a trigger runs to update a metadata date field (the date of a press release). The metadata field value is set to the following keword replacement and modifier:

 

 

So from our xml we're picking out <ReleaseDate>09/10/2013  00:00:00 UT</ReleaseDate> and taking the first ten characters: 09/10/2013, then changing the format to 2013/09/10. It's happily updating our release date metadata field to 9 October 2013 like this:

 

<meta name="Release Date" content="09/10/2013" />

 

We've found, however, that the date_format modifier doesn't like to convert any date above the 12th of a month. So if we had <ReleaseDate>14/10/2013 00:00:00 UT</ReleaseDate> it doesn't like it, and tries to update a date value of 1970/01/01 (which I think is UNIX year zero) to our metadata date field, the outcome is this:

 

<meta name="Release Date" content="01/01/1970" />

 

We've tried ^date_format:Y/m/d instead (swapping the day and month) and found that a date of <ReleaseDate>09/10/2013 00:00:00 UT</ReleaseDate> is updated as 10th September 2013, so making that change doesn't fix the problem.

 

Would be grateful for any thoughts on this.


(Ashish Karelia) #2

This seems like the same issue that's mentioned on #6637 Date_format keyword modifier on metadata in RSS asset expects different format.

The issue haven't been looked into yet though.

 

Ash


(Ian Hirst) #3

Thanks for pointing the way to that bug. I had to change the format of the date within the xml file to show dashes instead of slashes and then use date_format on that.