Skip to content

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

Closed
@YunYouJun

Description

@YunYouJun

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions