Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a type representing a "Date" as we use it in normal conversations--i.e. without time? #802

Open
funct7 opened this issue Sep 2, 2022 · 2 comments

Comments

@funct7
Copy link

funct7 commented Sep 2, 2022

Joda-time has the notion of a LocalDate, which is date without time; basically, what we mean by date in normal day-to-day English.
I'm wondering if the SwiftDate library has it.

I dug around a bit and am 99% sure there isn't, but just to be sure.
If there isn't, do you guys have any plans to support it?

Thank you :)

@funct7
Copy link
Author

funct7 commented Oct 29, 2022

@alex-x-x-x-x Thanks for the reference, but this doesn't really cut it.

For instance, if you have a coupon that is good until a certain day and are using a property with a type that really represents an "instance" in the time continuum, e.g. Date, the meaning is not really apparent. You'll either have to make it the midnight of the first "bad" date and check for less than or make it some arbitrary point in time of the last good date. Either way, it makes the code very confusing and unexpressive.

Sure it can be done, but that's like saying you only need a Int64 or TimeInterval because all use-cases can be covered. There's no need for time zones, date types, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants