using System; using System.Collections.Generic; using Microsoft.AspNetCore.Components; namespace AntDesign.Internal { public partial class DatePickerDatetimePanel : DatePickerPanelBase { [Parameter] public bool ShowToday { get; set; } = false; [Parameter] public bool IsShowTime { get; set; } = false; [Parameter] public string ShowTimeFormat { get; set; } [Parameter] public string Format { get; set; } [Parameter] public Func DisabledHours { get; set; } = null; [Parameter] public Func DisabledMinutes { get; set; } = null; [Parameter] public Func DisabledSeconds { get; set; } = null; [Parameter] public Func DisabledTime { get; set; } = null; private DatePickerDisabledTime GetDisabledTime() { List disabledHours = new List(); List disabledMinutes = new List(); List disabledSeconds = new List(); if (DisabledHours != null) { disabledHours.AddRange(DisabledHours(Value)); } if (DisabledMinutes != null) { disabledMinutes.AddRange(DisabledMinutes(Value)); } if (DisabledSeconds != null) { disabledSeconds.AddRange(DisabledSeconds(Value)); } DatePickerDisabledTime userDisabledTime = DisabledTime?.Invoke(Value); if (userDisabledTime != null) { if (userDisabledTime._disabledHours != null) { disabledHours.AddRange(userDisabledTime._disabledHours); } if (userDisabledTime._disabledMinutes != null) { disabledMinutes.AddRange(userDisabledTime._disabledMinutes); } if (userDisabledTime._disabledSeconds != null) { disabledSeconds.AddRange(userDisabledTime._disabledSeconds); } } return new DatePickerDisabledTime(disabledHours.ToArray(), disabledMinutes.ToArray(), disabledSeconds.ToArray()); } } }