question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Customize date string delimiter

See original GitHub issue

Feature request:

By default, we use vue-i18n, the string formatted use slash as delimiter, 2018/05/01, we hope to customize it as 2018-05-01.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
swiknabacommented, Jan 21, 2021

what would be the problem with the standard, if vue-i18n would introduce e.g. separator as an option for dateTimeFormats (as in https://kazupon.github.io/vue-i18n/guide/datetime.html) to allow any custom separator? It is good, to default to a standard, but it should be possible, to customize that.

1reaction
Dylan-Israelcommented, Mar 19, 2019

@fengerzh you can just add a custom filter like so.

filters: { delimiter(value: string) { return value.replace(/\//g, '-'); } }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom date and time format strings | Microsoft Learn
Learn to use custom date and time format strings to convert DateTime or DateTimeOffset values into text representations, or to parse strings ......
Read more >
How to format a date/datime having optional separator and ...
I´m giving the user the power to choose the date format and the date separator that will be used.
Read more >
Date and Time Literals - MariaDB Knowledge Base
A DATE string is a string in one of the following formats: 'YYYY-MM-DD' or 'YY-MM-DD' . Note that any punctuation character can be...
Read more >
Everything You Need to Know About Date in JavaScript
In JavaScript, if you want to use a date string, you need to use a format that's accepted worldwide. One of these formats...
Read more >
Date and time - The Modern JavaScript Tutorial
The character "T" is used as the delimiter. ... The call to Date.parse(str) parses the string in the given format and returns the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found