Skip to content

Commit cad9c2a

Browse files
feat(validate_config): add warning
1 parent 0c60e6f commit cad9c2a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/hexo/validate_config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ export = (ctx: Hexo): void => {
2727
}
2828

2929
if (!config.timezone) {
30-
log.warn('No timezone setting detected! Using the default timezone UTC.');
31-
config.timezone = 'UTC';
30+
log.warn('No timezone setting detected! Using LocalTimeZone as the default timezone.');
31+
log.warn('This behavior will be changed to UTC in the next major version. Please set timezone explicitly (e.g. LocalTimeZone or America/New_York) in _config.yml to avoid this warning.');
32+
config.timezone = moment.tz.guess();
33+
} else if (config.timezone.toLowerCase() === 'localtimezone') {
34+
config.timezone = moment.tz.guess();
3235
} else {
3336
const configTimezone = moment.tz.zone(config.timezone);
3437
if (!configTimezone) {

0 commit comments

Comments
 (0)