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

use getDate not getDay and simplify date logic #10178

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

riknoll
Copy link
Member

@riknoll riknoll commented Sep 12, 2024

fixes microsoft/pxt-microbit#5935

turns out the getDay() method returns the index of the day of the week not the day of the month! I guess those just happened to coincide last week while i was testing this ¯\_(ツ)_/¯

the correct method to use is the confusingly named getDate()

i also fixed up the 'x days ago' logic so that it's a little easier to read

@riknoll riknoll requested a review from a team September 12, 2024 17:58
@riknoll riknoll merged commit bb44cc1 into master Sep 12, 2024
7 checks passed
@riknoll riknoll deleted the dev/riknoll/date-day-confusion branch September 12, 2024 18:07
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

Successfully merging this pull request may close these issues.

Version History - today is Yesterday
3 participants