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

Bug fix, Calculated the weekday text from the local date. #61

Merged
merged 1 commit into from Nov 26, 2022

Conversation

BlakeTNC
Copy link
Contributor

This fixes a bug where the weekday text was not being calculated from the local date.

This fixes a bug where the weekday text was not being calculated from the local date.
@BlakeTNC
Copy link
Contributor Author

JS is not one of my native programming languages. So please look at some things, listed below.

I'm fairly confident I generated the correct weekday with:
var weekdayNumeric = localDate.getUTCDay();
var weekdayText = weekdayArray[weekdayNumeric];

However, I struggled to transfer the data from the scope where it is being generated, to the scope where it needs to be used and displayed. I made a new JS array "allWeekdays", but JS arrays are new to me so I'm not qualified to evaluate the quality of the array related code. Please check over the following items and see if they make sense to you:

  • Look at all the lines that use the allWeekdays variable. See if those lines make sense.
  • Also evaluate if it made sense that I used the "formattedDate" and "allDatesInOrder[i]" as array keys. I mostly chose those keys because that's what it looked like the original code was doing, to transfer some other pieces of data between those two scopes.

@Alys
Copy link
Owner

Alys commented Nov 24, 2022

Thanks again! I'll try to look at this in detail on Saturday.

@Alys Alys merged commit 00b9582 into Alys:develop Nov 26, 2022
@Alys
Copy link
Owner

Alys commented Nov 26, 2022

That's great, thank you very much! I've made it live and noted this PR as progress towards Tier 3.

Your code seems fine. I adjusted it slightly to make the array declaration briefer and to remove the unused 'style' parameter from the date function: 059c54d

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.

None yet

2 participants