Search This Blog

Sunday, November 13, 2016

WeightLifts Date Bug

I recently discovered a bug in WeightLifts that prevented entries made on single digit dates (so, November 7, November 8, etc.) from showing up properly in history and when exported. 

The cause of the bug was a change in the way dates were displayed after the update to Swift 3. 

I had set all dates to be formatted as "MMMM dd, yyyy" which meant that dates would show up as "November 07, 2016" for example. Note the "0" before the 7. After the update, however, Apple began removing the leading "0". Since I save all my date info as strings of text instead of date objects (I find it's easier to search for strings), when retrieving data (to populate previous workout info for example) the app was searching for "November 8, 2016" when the data was saved as "November 08, 2016" and thus not finding anything. 

I have corrected the bug, and will be releasing an update towards the end of the week (after some testing). This update will contain a little bit of code that will also go through and format all the date entries to the original double digit date style. For those of you with lots of entries, you may find slight delays when loading the app. I will remove this bit of code after 3 weeks, once everyone has updated.