from datetime import datetime, timedelta
import dash_mantine_components as dmc
from dash import Dash, _dash_renderer, html
_dash_renderer._set_react_version("18.2.0")
app = Dash(external_stylesheets=dmc.styles.ALL)
today = datetime.now().date()
component = dmc.DatePicker(
label="DatePicker with date objects",
value=today,
disabledDates=[today + timedelta(days=1), today + timedelta(days=3)],
m="lg"
)
component2 = dmc.DatePicker(
label="DatePicker with date strings",
value="2024-11-05",
disabledDates=["2024-11-04", "2024-11-06"],
m="lg"
)
app.layout = dmc.MantineProvider([
dmc.Title("dmc.DatePicker with disabled dates"),
component,
component2,
])
if __name__ == "__main__":
app.run(debug=True)