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

Created dayname function #31

Merged
merged 2 commits into from
Sep 29, 2022
Merged

Created dayname function #31

merged 2 commits into from
Sep 29, 2022

Conversation

Kacique
Copy link
Collaborator

@Kacique Kacique commented Sep 29, 2022

Dayname function displays what day it is above the aqi forecast number

@kmausolf
Copy link
Collaborator

Hey @Kacique, please pull in the changes from development so we can resolve the conflicts. I'll conduct a review afterward. Thanks!

Copy link
Collaborator

@kmausolf kmausolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done on this!

Comment on lines +24 to +39
const dayname = (date: string) => {

const days = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
];

const dt = new Date(date);
const day = dt.getDay();
return days[day];
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clever way of getting the day!

Comment on lines +92 to +93
<Text>{aqiInfo ? dayname(aqiInfo.forecast.daily.pm25[4].day) : "N/A"}</Text>
<Text>{aqiInfo ? aqiInfo.forecast.daily.pm25[4].avg : "N/A"}</Text>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart, checking for null

@Kacique Kacique merged commit 5606b73 into development Sep 29, 2022
@Kacique Kacique deleted the forecast-widget branch September 29, 2022 21:38
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.

2 participants