How to use the ng-devui/utils.DefaultDateConverter function in ng-devui

To help you get started, we’ve selected a few ng-devui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DevCloudFE / ng-devui / devui / datepicker / datepicker.directive.ts View on Github external
constructor(private elementRef: ElementRef, private viewContainerRef: ViewContainerRef,
              private componentFactoryResolver: ComponentFactoryResolver, private renderer2: Renderer2,
              private injector: Injector, private devUIConfig: DevUIConfig, private i18n: I18nService,
              private builder: AnimationBuilder) {
    this._dateConfig = devUIConfig[`datePicker${i18n.getLangSuffix()}`];
    this.dateConverter = devUIConfig[`datePicker${i18n.getLangSuffix()}`].dateConverter || new DefaultDateConverter();
    this.selectedDate = null;
    const factory = this.componentFactoryResolver.resolveComponentFactory(DatepickerComponent);
    this.cmpRef = this.viewContainerRef.createComponent(factory, this.viewContainerRef.length, this.injector);
    this.i18n.getMessage().subscribe((lang) => {
      const langSuffix = lang === 'zh-CN' ? 'CN' : 'EN';
      this._dateConfig = devUIConfig[`datePicker${langSuffix}`];
    });
  }
github DevCloudFE / ng-devui / devui / datepicker / datepicker.component.ts View on Github external
constructor(
    protected elementRef: ElementRef,
    protected renderer2: Renderer2,
    protected devUIConfig: DevUIConfig,
    protected changeDetectorRef: ChangeDetectorRef,
    protected i18n: I18nService
  ) {
    this._dateConfig = this.devUIConfig[`datePicker${i18n.getLangSuffix()}`];
    this.dateConverter = this.devUIConfig[`datePicker${i18n.getLangSuffix()}`].dateConverter || new DefaultDateConverter();
    this.renderer2.setStyle(this.elementRef.nativeElement, 'display', 'inline-block');
  }