]> git.ktnx.net Git - mobile-ledger.git/commitdiff
rework transaction date handling
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 16 Jun 2020 05:16:39 +0000 (05:16 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 17 Jun 2020 06:04:07 +0000 (06:04 +0000)
the surface problem is that storing dates as strings in hledger format
(yyyy/mm/dd) doesn't guarantee sort order. An year of 12020 is a typo,
but goes unnoticed and sorts earlier than 2020. Splitting the date into
separate numeric columns for year, month and day makes sorting work as needed.

While there, replace in-memory storage from java's Date to a SimpleDate
object which just holds the year, month and day. Simplifies exchanging
dates with the database and fulfils the task of holding a date just
fine. The extra flexibility of adding intervals to dates or holding
also time components is not needed anyway.


No differences found