Skip to content

Commit

Permalink
📅 Dates hot-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Zagidullin committed May 16, 2022
1 parent a3c346c commit 2801056
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/NextDay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const month = [
const NextDay = ({ icon, date, weather, tempDay, tempNight }: NextDayType) => {
const clarifyDate = (epoch: number) => {
const date = new Date(epoch * 1000);
return month[date.getMonth()] + " " + date.getDay();
return month[date.getMonth()] + " " + date.getDate();
};

return icon && date && weather && tempDay && tempNight ? (
Expand Down
2 changes: 0 additions & 2 deletions components/Sunset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ const Sunset = ({ sunrise, sunset }: SunsetType) => {
sunset: formatAMPM(sunset),
});

console.log(sunrise, now, sunset);

let nowFixed = now - sunrise;
let sunsetFixed = sunset - sunrise;
const gw = (nowFixed * 233) / sunsetFixed;
Expand Down
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Home: NextPage = () => {
<>
<h2>Next 5 days</h2>

{weatherData.daily.slice(0, 5).map((day: any, idx: number) => (
{weatherData.daily.slice(1, 6).map((day: any, idx: number) => (
<NextDay
icon={day.weather[0].icon}
date={day.dt}
Expand Down

0 comments on commit 2801056

Please sign in to comment.