2023-09-01 21:55:32 -04:00
|
|
|
#pragma once
|
|
|
|
|
#include <time.h>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
namespace widgets {
|
|
|
|
|
class DateTimePicker
|
|
|
|
|
{
|
|
|
|
|
private:
|
2023-09-03 11:03:37 -04:00
|
|
|
struct tm timestamp;
|
2023-11-12 10:24:32 -05:00
|
|
|
bool auto_time, show_picker, start_edit;
|
2023-09-03 09:59:54 -04:00
|
|
|
int year_holder, month_holder, seconds_decimal;
|
|
|
|
|
std::string d_id;
|
2024-12-11 13:30:10 -05:00
|
|
|
bool d_date_only;
|
2023-09-03 09:59:54 -04:00
|
|
|
void handle_input(double input_time);
|
2023-09-01 21:55:32 -04:00
|
|
|
public:
|
2024-12-11 13:30:10 -05:00
|
|
|
DateTimePicker(std::string id, double input_time, bool date_only = false);
|
2023-09-01 21:55:32 -04:00
|
|
|
~DateTimePicker();
|
2023-09-03 09:59:54 -04:00
|
|
|
double get();
|
|
|
|
|
void set(double input_time);
|
2023-09-01 21:55:32 -04:00
|
|
|
void draw();
|
|
|
|
|
};
|
|
|
|
|
} // namespace widgets
|