Skip to content

refactor(moment): remove unused timezone setting#5654

Merged
stevenjoezhang merged 3 commits intomasterfrom
timezone
Apr 22, 2025
Merged

refactor(moment): remove unused timezone setting#5654
stevenjoezhang merged 3 commits intomasterfrom
timezone

Conversation

@stevenjoezhang
Copy link
Member

@stevenjoezhang stevenjoezhang commented Apr 20, 2025

What does it do?

  1. According to permalink date is incorrect if the time zone of _config.yml and the time zone setting of the machine are different #3282 (comment), variables in ctx.config in lib/models/page.ts and lib/models/post.ts are Hexo default config, instead of variables from _config.yml.
    Removing the code only affects its own unit tests, no other functionalities are affected.
    I propose to remove it because it's not used and may cause confusion when developing timezone-related features.
  2. Besides, I renamed timezone function in common.ts to adjustDateForTimezone, to make the name more precise.

Screenshots

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@github-actions
Copy link

How to test

git clone -b timezone https://github.com/hexojs/hexo.git
cd hexo
npm install
npm test

@coveralls
Copy link

coveralls commented Apr 20, 2025

Pull Request Test Coverage Report for Build 14575535317

Details

  • 15 of 15 (100.0%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.001%) to 99.525%

Totals Coverage Status
Change from base Build 14575173355: -0.001%
Covered Lines: 9858
Relevant Lines: 9905

💛 - Coveralls

Copy link
Member

@yoshinorin yoshinorin left a comment

Choose a reason for hiding this comment

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

Regarding the title of the PR, shouldn't it be refactor instead of feat? 🤔

@stevenjoezhang stevenjoezhang changed the title feat(moment): remove unused timezone setting refactor(moment): remove unused timezone setting Apr 21, 2025
Copy link
Member

@yoshinorin yoshinorin left a comment

Choose a reason for hiding this comment

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

LGTM 👌

@stevenjoezhang stevenjoezhang merged commit 4b325f3 into master Apr 22, 2025
23 of 24 checks passed
@stevenjoezhang stevenjoezhang deleted the timezone branch April 22, 2025 14:14
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.

4 participants