Skip to main content
Module

x/netlify_cms_config/mod.ts>DateTime

Netlify CMS config generator
Latest
class DateTime
extends Field<Options>
Re-export
import { DateTime } from "https://deno.land/x/netlify_cms_config@v0.3.2/mod.ts";

Constructors

new
DateTime(label: string, config?: Options)

Properties

widget: string

Methods

dateFormat(date_format: string | boolean): this

Sets date display format in UI. boolean or Moment.js tokens. If true use default locale format.

default(date: string): this

Accepts a datetime string, or an empty string to accept blank input. Otherwise defaults to current datetime

format(format: string): this

Sets storage format; accepts Moment.js tokens. Defaults to raw Date object (if supported by output format)

pickerUtc(picker_utc?): this

When set to true, the datetime picker will display times in UTC. When false, the datetime picker will display times in the user's local timezone. When using date-only formats, it can be helpful to set this to true so users in all timezones will see the same date in the datetime picker.

timeFormat(time_format: string | boolean): this

Sets time display format in UI; boolean or Moment.js tokens. If true use default locale format, false hides time-picker.

Static Properties

defaults: Options