Repository navigation
time: check if a day is a valid day of its month - #19232
Merged
Merged
Conversation
ttytm
marked this pull request as draft
August 28, 2023 23:24
ttytm
force-pushed
the
time.parser/check-leap-year
branch
3 times, most recently
from
August 28, 2023 23:47
6846f60 to
c1d1710
Compare
ttytm
force-pushed
the
time.parser/check-leap-year
branch
from
August 28, 2023 23:53
c1d1710 to
20fb7b2
Compare
ttytm
marked this pull request as ready for review
August 28, 2023 23:54
Contributor
|
We're probably just gonna have to do a check for most months. The modified code needs to check for import time
fn main() {
if t := time.parse_format('June 31, 2023', 'MMMM DD, YYYY') {
println(t)
} else {
println('parse failed')
}
} |
ttytm
marked this pull request as draft
August 29, 2023 03:35
ttytm
marked this pull request as ready for review
August 29, 2023 04:04
ttytm
force-pushed
the
time.parser/check-leap-year
branch
from
August 29, 2023 04:06
f339d33 to
fe22b0d
Compare
ttytm
force-pushed
the
time.parser/check-leap-year
branch
from
August 29, 2023 04:08
fe22b0d to
5375779
Compare
Contributor
|
Needs tests too, to prevent regressions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #19230
π€ Generated by Copilot at 4b56aa7
Improved date validation in
timemodule by adding leap year check indate_time_parser.v.π€ Generated by Copilot at 4b56aa7
needs_leap_yearto track if the parsed date requires a leap year or not (link)needs_leap_yearto true if the parsed month is February and the parsed day is 0 or 29, otherwise false, for different date formats (link, link, link)needs_leap_yearis true but the parsed year is not a leap year, to prevent invalid dates (link)