Methods
# static datetimeToTimestamp(date)
Valid date parseable with moment
Parameters:
| Name | Type | Description |
|---|---|---|
date |
*
|
# static formatDate(date, options)
FR Example: DD/MM/YYYY
Parameters:
| Name | Type | Description |
|---|---|---|
date |
*
|
|
options |
*
|
# static formatDatetime(date, options)
FR Example: DD/MM/YYYY HH:mm
Parameters:
| Name | Type | Description |
|---|---|---|
date |
*
|
|
options |
*
|
# static formatDatetimeWithSeconds(date, options)
FR Example: DD/MM/YYYY HH:mm:ss
Parameters:
| Name | Type | Description |
|---|---|---|
date |
*
|
|
options |
*
|
# static formatTime(date, options)
FR example: HH:mm
Parameters:
| Name | Type | Description |
|---|---|---|
date |
*
|
|
options |
*
|
# static formatTimeWithSeconds(date, options)
FR example: HH:mm:ss
Parameters:
| Name | Type | Description |
|---|---|---|
date |
*
|
|
options |
*
|
# inner formatDateInternal(date)
Use instead: formatDatetimeWithSeconds, formatDatetime, formatDate, formatTime and formatTimeWithSeconds
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
date |
String
|
Moment
|
Date
|
null | Any valid date as string or Moment instance |
options.onlyTime |
Boolean
|
Default to false |
|
options.onlyDate |
Boolean
|
Default to false |
|
options.fallbackValue |
String
|
Value to display if invalid date (Default to an empty string) |
|
options.locale |
String
|
Locale code (i.g fr) (Defaults to i18n library current locale) |
|
options.inputFormat |
String
|
Custom input format (i.g HH:mm:ss MM-YYYY-DD) |
|
options.seconds |
Boolean
|
Add seconds to time format |
- To Do:
-
- Add milliseconds support