-
Notifications
You must be signed in to change notification settings - Fork 320
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
[stdlib] Improve the Time library for Luna #59
Conversation
stdlib/Std/src/Base.luna
Outdated
## Returns a TimeInterval with the length of `self` days. | ||
def days: self*24 . hours | ||
## Returns a TimeInterval with the length of `self` weeks. | ||
def days: self*7 . days |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This recursion never ends.
stdlib/Std/src/Base.luna
Outdated
## Returns a TimeInterval with the length of `self` fortnights. | ||
def fortnights: self*2 . weeks | ||
## An alias for `miliseconds` | ||
def milisecond: self.miliseconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the singulars, this is too much
stdlib/Std/src/Base.luna
Outdated
## Returns a TimeInterval with the length of `self` weeks. | ||
def days: self*7 . days | ||
## Returns a TimeInterval with the length of `self` fortnights. | ||
def fortnights: self*2 . weeks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fortnight is not that useful. But a month or a year would be much more welcome :)
Ooops, why did I merge and not rebase ;( Ha, fixed! 🥇 |
728338a
to
080a2b6
Compare
stdlib/Std/src/Time.luna
Outdated
|
||
def midnight: TimeOfDayVal 0 0 0.0 | ||
|
||
def midday: TimeOfDayVal 12 0 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noon
?
0ca9800
to
9619838
Compare
@kustosz I removed the tests, because it turned out they made little sense. But fixed all the errors I encountered along the way. I think I'll merge this one and open a new one to create some tests. |
{beginning, end}Of{Day, Month, Year}
Std.hs
file, just for (my) convenience.NOTE: I decided to do the timezone support as a separate PR, this is big enough.