pretty-print icon indicating copy to clipboard operation
pretty-print copied to clipboard

Treat date and datetime as atomic

Open derlin opened this issue 4 years ago • 4 comments

When using e.g. LocalDate, the result of pp looks like:

dateOfBirth = LocalDate(
    MIN = LocalDate.<static cyclic class reference>
    MAX = LocalDate.<static cyclic class reference>
    EPOCH = LocalDate.<static cyclic class reference>
    serialVersionUID = 2942565459149668126
    DAYS_PER_CYCLE = 146097
    DAYS_0000_TO_1970 = 719528
    year = 1988
    month = 6
    day = 13
  )

while the output of toString is way more relevant for debug purposes:

"1988-06-13"

I suggest adding Date, LocalDate, DateTime and LocalDateTime to the list of atomic classes, so that their toString method is used instead.

(P.S: I would like to take this issue for the hacktoberfest 2021 if you are interested in this enhancement).

derlin avatar Oct 10 '21 16:10 derlin

Oh goodness, I completely missed this issue. I'm sorry about that. This is a great ticket. If you want to take it you totally can. I probably won't have time to add this for a while.

snowe2010 avatar Feb 16 '22 02:02 snowe2010