Date

Date field displays the value as a formatted date. And long, short etc. Supports all localized formats. Basically use $d, VueI18n function.

<template>
  <va-date-field source="publicationDate" format="short"></va-date-field>
</template>

Creates a formatted date within the range:

<span>Sunday, November 18, 1984</span>

Format

src/i18n/rules/datetime.js

export default {
  en: {
    year: {
      year: "numeric",
    },
    month: {
      month: "short",
    },
    shortFormat: {
      dateStyle: "short",
    },
    longFormat: {
      year: "numeric",
      month: "long",
      day: "numeric",
      weekday: "long",
      hour: "numeric",
      minute: "numeric",
      hour12: false,
    },
  }
}

Check out the Vue i18n documentation for more details.

Mixins

  • Field
  • Source
  • Resource

Properties

Property Type Description
source string The property of the resource to fetch the value to display. Supports dot display for slot used object.
item null Overrides the default element added by VaShow.
format string The date format to use. For example: (dd-mm-YYYY).