Wrong date in exported HTML

Report your bugs here - if someone else has already mentioned the same bug, just add on to their post with as much info as possible to make the hunting easier.
Post Reply
Black Smurf
Addicted to Bruji
Addicted to Bruji
Posts: 30
Joined: Mon Mar 26, 2007 11:15 am
Location: Germany

Wrong date in exported HTML

Post 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>
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Wrong date in exported HTML

Post 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.
Black Smurf
Addicted to Bruji
Addicted to Bruji
Posts: 30
Joined: Mon Mar 26, 2007 11:15 am
Location: Germany

Re: Wrong date in exported HTML

Post by Black Smurf »

Thanks for the quick solution - now it works as expected :)
Post Reply