Flix01 / imgui

Dear ImGui Addons Branch = plain unmodified dear imgui plus some extra addon.
https://github.com/Flix01/imgui/wiki/ImGui-Addons-Branch-Home
MIT License
396 stars 34 forks source link

DateChooser: even better date/time widgets #64

Closed cyrilRomain closed 2 years ago

cyrilRomain commented 2 years ago

Major rewrite except the calendar display algorithm.

New API:

Features improvments:

Code:

Examples:

Flix01 commented 2 years ago

@cyrilRomain, thank you for your effort!

I still have to test it, but I think that having three widgets is better than one!

Some notes:

But, aside from these things, I think it's a useful improvement. Thank you again for having spent your time on it.

Edit: [*] Maybe imguiinputdatetime.h/.cpp or just imguidatetime.h/.cpp could be OK. and having the "Input" prefix is more consistent with other Imgui widgets... so it was a good choice not to append "Chooser" when "Input" is used. In short: forget point 1: just removing the underscore in imgui_datetime is OK for me.

cyrilRomain commented 2 years ago

@Flix01 thank for your feedback

@Flix01's edit: (pasted the screenshot here): image

Flix01 commented 2 years ago

Seems OK to me. Just one more thing before merging it:

Can you please modify the code this way?

#ifdef IMGUIDATETIME_DISPLAYSUNDAYFIRST
static bool sunday_first = true; // display sundays first (like before)
#else
static bool sunday_first = false; // display mondays first as ISO 8601 suggest
#endif
cyrilRomain commented 2 years ago

Good point. Fix done in last commit (with file renaming I forgot to rename back w/o "chooser"). Feel free to squash when merging.