Table of Contents
Examples
Basic UsageCustom Format
JavaScript Reference
ConstructorRequirements
Attributes
Properties
Methods
Description
The Timestamp
component displays a formatted timestamp. It extends the Component class.
Basic Usage
Use the Timestamp
component to display a formatted timestamp. The component will automatically format the timestamp based on the provided locale or the user's current locale if no locale is provided.
<k-timestamp timestamp="1633024800000"></k-timestamp>
Custom Format
Use the format
attribute to specify a custom format for the timestamp. The format should be a string like YYYY-MM-DD hh:mm:ss:iiii
.
<k-timestamp timestamp="1633024800000" format="YYYY-MM-DD hh:mm:ss"></k-timestamp>
JavaScript Reference
Constructor
Extends Component
new Timestamp(timestamp, format, locale)
Parameters
timestamp: number
The timestamp to be formatted and displayed.
format: string
The format to be used for formatting the timestamp. If not provided, the user's current locale format will be used.
locale: string
The locale to be used for formatting the timestamp. If not provided, the user's current locale will be used.
Requirements
Attributes
timestamp: number
The timestamp to be formatted and displayed.
format: string
The format to be used for formatting the timestamp. If not provided, the user's current locale format will be used.
locale: string
The locale to be used for formatting the timestamp. If not provided, the user's current locale will be used.
Methods
The Timestamp
class does not introduce any new methods beyond those provided by the Component class.