Skip to content

Commit

Permalink
update import moment
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaslanjaka committed Jan 9, 2023
1 parent e729d7a commit ea3821f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/post/permalink.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import * as momentlib from 'moment-timezone';
import momentlib, { tz } from 'moment-timezone';
import * as path from 'upath';
import debug from '../utils/debug';
import { getConfig } from '../_config';

const moment = (input: momentlib.MomentInput) => momentlib.default(input).tz(getConfig().timezone);
const moment = (input: momentlib.MomentInput) => {
tz.setDefault(getConfig().timezone || 'UTC');
return momentlib(input).tz(getConfig().timezone || 'UTC');
};

/**
* transform permalink format in `_config.yml`
Expand Down

0 comments on commit ea3821f

Please sign in to comment.