ladybird/Userland/Libraries/LibGUI/DatePicker.h
david072 039114b728 Calendar: Move MonthListModel into Calendar.h
Previously, we had two versions of MonthListModel for the AddEventDialog
and the DatePickerDialog. Now, a unified version is in the Calendar.h
file, which can be used easily by anyone. Since that model and the
MeridiemListModel weren't used anymore in the AddEventDialog, I have
also removed them from there.
2024-01-06 10:37:53 -07:00

33 lines
767 B
C++

/*
* Copyright (c) 2023, David Ganz <david.g.ganz@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/String.h>
#include <LibCore/DateTime.h>
#include <LibGUI/Calendar.h>
#include <LibGUI/Dialog.h>
#include <LibGUI/Model.h>
namespace GUI {
class DatePicker : public Dialog {
C_OBJECT(DatePicker)
public:
virtual ~DatePicker() override = default;
static Optional<Core::DateTime> show(Window* parent_window, String title, Core::DateTime focused_date = Core::DateTime::now());
private:
explicit DatePicker(Window* parent_window, String const& title, Core::DateTime focused_date = Core::DateTime::now());
Core::DateTime m_selected_date;
RefPtr<ComboBox> m_month_box;
RefPtr<SpinBox> m_year_box;
};
}