/// <inheritdoc/> protected override async Task OnFirstAfterRenderAsync() { object defaultDate = null; // for multiple mode default dates must be set as array if (SelectionMode != DateInputSelectionMode.Single) { defaultDate = Dates?.Select(x => FormatValueAsString(new TValue[] { x }))?.ToArray(); } else { defaultDate = FormatValueAsString(new TValue[] { Date }); } await JSModule.Initialize(ElementRef, ElementId, new { InputMode, SelectionMode = SelectionMode.ToDateInputSelectionMode(), FirstDayOfWeek = (int)FirstDayOfWeek, DisplayFormat = DateTimeFormatConverter.Convert(DisplayFormat), TimeAs24hr, DefaultDate = defaultDate, Min = Min?.ToString(DateFormat), Max = Max?.ToString(DateFormat), Disabled, ReadOnly, DisabledDates = DisabledDates?.Select(x => FormatValueAsString(new TValue[] { x })), Localization = GetLocalizationObject() }); await base.OnFirstAfterRenderAsync(); }
/// <inheritdoc/> protected override async Task OnFirstAfterRenderAsync() { await JSModule.Initialize(ElementRef, ElementId, new { InputMode, FirstDayOfWeek, DisplayFormat = DateTimeFormatConverter.Convert(DisplayFormat), TimeAs24hr, Default = FormatValueAsString(Date), Min = Min?.ToString(DateFormat), Max = Max?.ToString(DateFormat), Disabled, ReadOnly, DisabledDates = DisabledDates?.Select(x => FormatValueAsString(x)), }); await base.OnFirstAfterRenderAsync(); }