forked from androidx/androidx
-
Notifications
You must be signed in to change notification settings - Fork 81
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
DatePicker. Fix today circle #782
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
82aac5b
apply locale before pattern on darwin
alexzhirkevich 4e80c9e
Merge branch 'jb-main' of https://github.com/alexzhirkevich/compose-m…
alexzhirkevich 274d556
Merge branch 'jb-main' of https://github.com/alexzhirkevich/compose-m…
alexzhirkevich f196d45
datepicker today circle fix
alexzhirkevich aae821a
utc
alexzhirkevich 135cc22
day of week
alexzhirkevich 9292441
weekdays
alexzhirkevich ad02921
comment
alexzhirkevich b472b97
apply suggestion
alexzhirkevich 6a9b273
refactor atStartOfDay -> at midnight
alexzhirkevich 5af54d1
midnight outside the class
alexzhirkevich 37d4fca
midnight outside the class
alexzhirkevich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
https://kotlinlang.org/api/kotlinx-datetime/kotlinx-datetime/kotlinx.datetime/at-start-of-day-in.html says
atStartOfDay
isn't necessarily at midnight, and we do want midnight here because of howisToday
is computed:that's why I suggested to use
atTime(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.
Or maybe both will be wrong, that is neither will match
dateInMillis
? I'm not sure. The wayisToday
is computed looks bad to me.But Android uses
so maybe it's better to stick with that, unless you're sure
atStartOfDayIn
is correct.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.
Hmm, this is what CalendarModel interface comments (from canonical date method) says about it:
compose-multiplatform-core/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/CalendarModel.kt
Lines 94 to 95 in 8f57b8c
So it does not exactly say it needs to be 00:00, but start of day 🤔
Maybe
today
method should behave differentlyNewer android calendar model takes it at midnight, lets do the same
(but canonical date it takes at start of day 🥲🔫)
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.
Aligned all methods with the Android implementation