Type class
Handles date and time formatting.
Click here Tutorial on date/time formatting
@todo Better type casting of passed in date?
@todo Quarter support?
@todo When parsing named months make the search case-insensitive
@todo Escape a.m./p.m. properly when used in RegEx
Sources
DateFormatter can be used (imported) via one of the following packages.
/** * -------------------------------------------------------- * Import from: "core.ts" * Use like: am4core.DateFormatter * -------------------------------------------------------- */ import * as am4core from "@amcharts/amcharts4/core";
/** * -------------------------------------------------------- * Include via: <script src="core.js"></script> * Access items like: am4.DateFormatter * -------------------------------------------------------- */
Inheritance
DateFormatter extends BaseObject
.
DateFormatter is not extended by any other symbol.
Properties
capitalize # |
Type Default Should the first letter of the formatted date be capitalized? |
---|---|
clonedFrom # |
Type Inherited from Reference to the original object this object was cloned from. We need to keep this so we can disassociate it from source object when this object is disposed. |
config # |
Type Inherited from Use this property to set JSON-based config. When set, triggers processing routine, which will go through all properties, and try to apply values, create instances, etc. Use this with caution, as it is a time-consuming process. It's used for initialchart setup only, not routine operations. |
dateFormat # |
Type Default Date format to use. If format is not supplied in-line in the string, this setting will be used. |
firstDayOfWeek # |
Type First day of the week:
|
id # |
Type Inherited from Sets the user-defined id of the element. |
inputDateFormat # |
Type Default Date format to use when parsing dates. |
intlLocales # |
Type Locales if you are using date formats in |
language # |
Type A reference to |
months # |
Type Default A list of month names. |
monthsShort # |
Type Default A list of short month names. |
sprite # |
Type Holds reference to parent |
timezone # |
Type If set, will format date/time in specific time zone. The value should be named time zone, e.g.:
@since 4.10.1 |
timezoneOffset # |
Type If set, will apply specific offset in minutes before formatting the date text. The value is a number of minutes from target time zone to UTC. E.g. |
uid # |
Type Inherited from Returns object's internal unique ID. |
utc # |
Type Should formatter use UTC functions? If UTC is used, all date/time values will be independent on client's time zone. |
weekdays # |
Type Default A list of weekday names. |
weekdaysShort # |
Type Default A list of short weekday names. |
There are 4 inherited items currently hidden from this list. |
Methods
clone( cloneId?: ) |
Returns Inherited from Makes a copy of this object and returns the clone. Try to avoid cloning complex objects like chart, create new instances if you need them. |
---|---|
constructor() |
Returns Constructor |
copyFrom( object: ) |
Returns Inherited from Copies all properties and related data from different element. |
dispose() |
Returns Inherited from Destroys this object and all related data. |
format( source: ) |
Returns Formats the date value according to specified format. Click here Tutorial on date/time formatting |
getCurrentThemes() |
Returns Inherited from Returns a list of themes that should be applied to this element. It could either be a list of themes set explicitly on this element, or system-wide. |
isDisposed() |
Returns Inherited from Returns if this object has been already been disposed. |
parse( source: ) |
Returns Parses any input value into Date object. Click here Tutorial on date/time parsing |
There are 5 inherited items currently hidden from this list. |
Events
DateFormatter does not have any events.
Adapters
DateFormatter does not have any adapters.