### 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

providers | `TranslateService`
selector | `time[eclDateBlock]`
imports | `DatePipe`
templateUrl | `./ecl-date-block.component.html`

### Index

###### Properties
locale
###### Methods
getCssClasses
###### Inputs
date dateFormat datetime day month monthTitle variant year class e2eAttr tabindex
###### HostBindings
class
###### Accessors
cssClasses datetime

### Constructor

`constructor(translateService: TranslateService)`
Parameters :
Name | Type | Optional
translateService | `TranslateService` | No

### 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
get `cssClasses()`

datetime
get `datetime()`
Sets the `datetime` attribute of the `<time>` element. If not provided, it is derived from `date` and `dateFormat`. Returns : `string`
set `datetime(value)`
Parameters :
Name | Optional
value | No
Returns : `void`

# results matching ""

# No results matching ""