Page 1 of 1

Wrong date in exported HTML

Posted: Wed Jan 28, 2015 4:06 pm
by Black Smurf
I have encountered a very strange problem with DVDpedia 5.3.2:

I recently entered a few new disks with "purchased" date 29.12.2014. Now every time I export my collection to HTML (using a slightly modified FancyIndex template), these disks get exported with "purchased" date 29.12.2015 (<td><div class="lbr">2015-12-29</div></td> in the html file). All disks I purchased/entered at dates before that or in the new year get exported correctly.
I tried deleting the contents of the "purchased" field, and then the date filed in the HTML export was empty, too. I re-entered the date and it gets exported again with the wrong year.

I encountered this phenomenon under OS X 10.9.5 and 10.10.2 (I just updated my system). Is this a bug or might this be caused by the export template (which I have been using for years without encountering such a problem)?
The relevant commands used in the template are just:

Code: Select all

<meta name="date-format" content="YYYY-MM-dd" />
...
<th id="translatePurchasedOn">[translate:purchasedOn]</th>
...
<td><div class="lbr">[key:purchasedOn]</div></td>

Re: Wrong date in exported HTML

Posted: Thu Jan 29, 2015 4:39 am
by Conor
Thank you for the bug report, at first I thought it was a bug in the NSDateFormatter. But after much researching I realized I set the formatter style in fancy index incorrectly. The "YYYY" format stands for the year that week falls in. For the most part a few days at the end of the year fall into the first week of the next year. Open the template and change the capitalized "YYYY" to lowercase "yyyy", this will be the year as we know it and not based on the current week.

I checked all the code for YYYY and it was only Fancy Index that had the mistake. I have fixed it for the next release. Thank you for the clear details and information, help me get this fixed right away.

Re: Wrong date in exported HTML

Posted: Thu Jan 29, 2015 11:31 am
by Black Smurf
Thanks for the quick solution - now it works as expected :)