mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 03:39:55 +00:00
Fixed clock module sunrise/sunset timezone bug (#3070)
Updated sunrise/sunset times to display user-requested timezone rather than system timezone. Note: rebase of #3069 against develop rather than master Co-authored-by: Veeck <github@veeck.de>
This commit is contained in:
parent
09f117c3d9
commit
dee3cd3da7
@ -152,7 +152,7 @@ const formatTime = (config, time) => {
|
||||
let date = moment(time);
|
||||
|
||||
if (config.timezone) {
|
||||
date = moment.tz(config.timezone);
|
||||
date = date.tz(config.timezone);
|
||||
}
|
||||
|
||||
if (config.timeFormat !== 24) {
|
||||
|
@ -114,24 +114,11 @@ describe("Default modules utils tests", () => {
|
||||
describe("formatTime", () => {
|
||||
const time = new Date();
|
||||
|
||||
beforeAll(() => {
|
||||
jest.useFakeTimers();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
jest.setSystemTime(new Date("2023-01-01 13:13"));
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
jest.setSystemTime(new Date());
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
jest.useRealTimers();
|
||||
time.setHours(13, 13);
|
||||
});
|
||||
|
||||
it("should convert correctly according to the config", () => {
|
||||
time.setHours(13, 13);
|
||||
expect(
|
||||
formatTime(
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user