Skip to content

Commit

Permalink
use UTC methods on Date when getting day names
Browse files Browse the repository at this point in the history
  • Loading branch information
WickyNilliams committed May 23, 2024
1 parent 75fb71d commit 1df6a8e
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.1] - 2024-05-23

### Fixed

- Use UTC-based methods on `Date` when getting day names

## [0.6.0] - 2024-05-10

### Added
4 changes: 2 additions & 2 deletions src/utils/hooks.ts
Original file line number Diff line number Diff line change
@@ -88,9 +88,9 @@ export function useDayNames(
const day = new Date();

for (var i = 0; i < 7; i++) {
const index = (day.getDay() - firstDayOfWeek + 7) % 7;
const index = (day.getUTCDay() - firstDayOfWeek + 7) % 7;
days[index] = formatter.format(day);
day.setDate(day.getDate() + 1);
day.setUTCDate(day.getUTCDate() + 1);
}

return days;

0 comments on commit 1df6a8e

Please sign in to comment.