Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] add toLocaleString options for @vuepress/plugin-last-updated #2168

Closed
YunYouJun opened this issue Feb 4, 2020 · 2 comments

Comments

@YunYouJun
Copy link
Contributor

Feature request

add options config for @vuepress/plugin-last-updated

What problem does this feature solve?

In @vuepress/plugin-last-updated, toLocaleString is the default transformer.
toLocaleString has some options, so sometimes we don't need use custom transformer here.

Example: We just need pass { hour12: false } to get 24-hour.

What does the proposed API look like?

module.exports = {
  plugins: [
    [
      '@vuepress/last-updated',
      {
        options: {
          // more options
          // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString
          hour12: false
        }
      }
    ]
  ]
}

How should this be implemented in your opinion?

Add options param for defaultTransformer.

Are you willing to work on this yourself?

Yes.

@mishengqiang
Copy link

#2192 这个特性可能导致一些第三主题出现Invalid Date的错误,比如vuepress-theme-ououe主题。

相关的中文文档及时跟进,现在默认值还是undefined

@kefranabg
Copy link
Collaborator

Has been fixed in 369c315 . Will be in the next release

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

No branches or pull requests

3 participants