Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
374 views
in Technique[技术] by (71.8m points)

javascript - How to localize month names with vue-date-fns

<template>
  <div>
    {{ new Date(04,03,2021) | de }}
  </div>
</template>

<script>
  import { createDateFilter } from 'vue-date-fns'
  import { de } from "date-fns/locale";

  export default {
    filters: {
      de: createDateFilter('DD. MMMM', { locale: de }),
  }
</script>

Expected result is 04. Januar but what I get is 04. January. It completely ignores that I want to localize the date, so that the month name is in german in this case.

Couldn't find an answer anywhere. Help appreciated.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...