nuxt-date-formatter
v1.0.1
Published
A simple Nuxt.js plugin to format dates
Readme
Nuxt Date Formatter
A simple Nuxt.js plugin to format dates.
Note: This is a demo plugin.
Installation
To install this plugin, run:
pnpm add nuxt-date-formatterUsage
Register the plugin in your nuxt.config.js file:
import dateFormatter from 'nuxt-date-formatter'
export default {
buildModules: [
'@nuxt/typescript-build'
],
plugins: [
'~/plugins/dateFormatter.ts'
]
}Use the plugin in your components:
<template>
<div>
<h1>Formatted Date: {{ formattedDate }}</h1>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
@Component
export default class FormattedDate extends Vue {
date: string = '2025-02-26'
get formattedDate(): string {
return this.$formatDate(this.date)
}
}
</script>