improved readability of 'get_canonical_date'