Skip to content

:date inflation returning a timestamp instead of a date #185

@daninus14

Description

@daninus14

When a :date col-type is inflated, a local-time timestamp is returned instead of either just the string value of the date or an object representing a date. See here:

(:method ((col-type (eql :date)) value)

(local-time:universal-to-timestamp

Note that deflation is fine because it allows for the string value:

(:method ((col-type (eql :date)) value)

I would hope standard behavior for :date returns a date, whether as a string or an object, not a different data type.

Can we either return a string or at least use a date typed object?

There are a few libraries to deal with dates specifically, since local-time only deals with timestamps. See here: https://github.com/CodyReichert/awesome-cl?tab=readme-ov-file#date-and-time

Two in particular jumped to mind, both built on top of local-time:

It seems only periods is available in quicklisp: https://www.quicklisp.org/beta/releases.html

I would be happy to make a PR to fix this. I have no horse in choosing whichever library, I would just like for the dates to return a correct data type.

What do you think?

Originally posted by @daninus14 in #184

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions