<commit_before># VCLDateAdapter

The `VCLDateAdapter` is used for date operations within the `ng-vcl`.


### Date representation

The DateAdapter and components use the `VCLDate` generic type. The exact type is defined by the `VCLDateAdapter`.
The default implementation is using the native javascript date object.


#### Date range

A date range is defined by a start and an end date.

```ts
export interface VCLDateRange<VCLDate> {
  start: VCLDate;
  end: VCLDate;
}
```

### Localization

The default date adapter uses the javascript `Intl` interfaces for localization.
The angular `LOCALE_ID` token is used to determine the application locale.

Example:
```ts
import { LOCALE_ID } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';

platformBrowserDynamic().bootstrapModule(AppModule, {
  providers: [{provide: LOCALE_ID, useValue: 'de' }]
});
```

Check the [official docs](https://angular.io/guide/i18n) for further information.


### Weekday offset

Add the following provider for an offset

```ts
import { VCL_DATE_ADAPTER_WEEKDAY_OFFSET } from '@ng-vcl/ng-vcl';

@NgModule({
  providers: [
    // Calendar starts on Monday
    { provide: VCL_DATE_ADAPTER_WEEKDAY_OFFSET, useValue: 1 }
  ],
})
export class MyApp {}
```

### Custom date adapter

A custom adapter must extend from `VCLDateAdapter` and implement the abstract methods.

```ts
export class MyDateAdapter extends VCLDateAdapter<MyDate> {

  constructor(
    @Inject(VCL_DATE_ADAPTER_WEEKDAY_OFFSET)
    private weekDayOffset: number,
    @Optional()
    @Inject(LOCALE_ID)
    private locale?: string,
  ) {
    super();
  }

  // Abstract class implementation
  isDate(date: any): date is Date {
    ...
  }
  ...
}
```

```ts
import { VCLDateAdapter } from '@ng-vcl/ng-vcl';

@NgModule({
  providers: [
    // Calendar starts on Monday
    { provide: VCLDateAdapter, useClass: MyDateAdapter }
  ],
})
export class MyApp {}
```<commit_msg>chore(demo): fix<commit_after># VCLDateAdapter

The `VCLDateAdapter` is used for date operations within the `ng-vcl`.


### Date representation

The DateAdapter and components use the `VCLDate` generic type. The exact type is defined by the `VCLDateAdapter`.
The default implementation is using the native javascript date object.


#### Date range

A date range is defined by a start and an end date.

```ts
export interface VCLDateRange<VCLDate> {
  start: VCLDate;
  end: VCLDate;
}
```

### Localization

The default date adapter uses the javascript `Intl` interfaces for localization.
The angular `LOCALE_ID` token is used to determine the application locale.

Example:
```ts
import { LOCALE_ID } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';

platformBrowserDynamic().bootstrapModule(AppModule, {
  providers: [{provide: LOCALE_ID, useValue: 'de' }]
});
```

Check the [official docs](https://angular.io/guide/i18n) for further information.


### Weekday offset

Add the following provider for an offset

```ts
import { VCL_DATE_ADAPTER_WEEKDAY_OFFSET } from '@ng-vcl/ng-vcl';

@NgModule({
  providers: [
    // Calendar starts on Monday
    { provide: VCL_DATE_ADAPTER_WEEKDAY_OFFSET, useValue: 1 }
  ],
})
export class MyApp {}
```

### Custom date adapter

A custom adapter must extend from `VCLDateAdapter` and implement the abstract methods.

```ts
export class MyDateAdapter extends VCLDateAdapter<MyDate> {

  constructor(
    @Inject(VCL_DATE_ADAPTER_WEEKDAY_OFFSET)
    private weekDayOffset: number,
    @Optional()
    @Inject(LOCALE_ID)
    private locale?: string,
  ) {
    super();
  }

  // Abstract class implementation
  isDate(date: any): date is Date {
    ...
  }
  ...
}
```

```ts
import { VCLDateAdapter } from '@ng-vcl/ng-vcl';

@NgModule({
  providers: [
    { provide: VCLDateAdapter, useClass: MyDateAdapter }
  ],
})
export class MyApp {}
```
{'fraction_non_alphanumeric': 0.11588738059326295, 'fraction_numerical': 0.0015082956259426848, 'mean_word_length': 4.228646517739816, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4806195', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1232, 'n_words': 393}