File

packages/ecl/components/ecl-date-block/ecl-date-block.component.ts

Description

Component used to display a formatted date in a styled time element. Designed for use within content components such as content blocks or items.

Extends

ECLBaseDirective

Metadata

Index

Properties
Methods
Inputs
HostBindings
Accessors

Constructor

constructor()

Inputs

date
Type : Date

The date to be displayed. If not null, it's used to generate the datetime attribute and visual output.

dateFormat
Type : string
Default value : 'dd/M/yyyy'

The format to be used when rendering the date string (Angular DatePipe format). Default is 'dd/M/yyyy'.

datetime
Type : string

Sets the datetime attribute of the <time> element. If not provided, it is derived from date and dateFormat.

day
Type : string

Explicit string for day part of the date (optional). Used when date is not set or overridden manually.

month
Type : string

Explicit string for month part of the date (optional). Used when date is not set or overridden manually.

monthTitle
Type : string

Explicit string used as an accessible or verbose label for the month (optional).

variant
Type : "ongoing" | "past"
Default value : null

Optional visual variant of the date block. Can be:

  • 'ongoing': for ongoing events
  • 'past': for past events This changes styling only.
year
Type : string

Explicit string for year part of the date (optional). Used when date is not set or overridden manually.

class
Type : string
e2eAttr
Type : any
tabindex
Type : number

HostBindings

class
Type : string

Methods

getCssClasses
getCssClasses(rootClass: string)
Parameters :
Name Type Optional
rootClass string No
Returns : string

Properties

locale
Type : string
Default value : 'en'

Accessors

cssClasses
getcssClasses()
datetime
getdatetime()

Sets the datetime attribute of the <time> element. If not provided, it is derived from date and dateFormat.

Returns : string
setdatetime(value: unknown)
Parameters :
Name Type Optional
value unknown No
Returns : void

results matching ""

    No results matching ""