Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should I contribute a Date Picker? #8159

Closed
Brotcrunsher opened this issue Nov 18, 2024 · 3 comments
Closed

Should I contribute a Date Picker? #8159

Brotcrunsher opened this issue Nov 18, 2024 · 3 comments

Comments

@Brotcrunsher
Copy link
Contributor

Brotcrunsher commented Nov 18, 2024

Version/Branch of Dear ImGui:

Not necessary for the question

Back-ends:

Not necessary for the question

Compiler, OS:

Not necessary for the question

Full config/build information:

No response

Details:

Hi there!

I've made a rather simple but effective Date Picker for my own project and I wondered if it makes sense to add this to Dear ImGui. The current implementation is using custom types of my engine, so a bit of clean up would be necessary to use time_t instead. Before doing so, I wanted to check if this is even a wanted contribution to the base Dear ImGui project.

The header would probably look something like this:

bool DatePicker(const char* label, time_t* time, SomeKindOfFlags flags = First Day is Monday/Sunday...);

For a reference implementation see: https://github.com/Brotcrunsher/BrotBoxEngine/blob/master/BrotBoxEngine/ImGuiExtensions.cpp#L93 (Final pull request version would look quite a bit different)

Screenshots/Video:

image

Minimal, Complete and Verifiable Example code:

No response

@ocornut
Copy link
Owner

ocornut commented Nov 18, 2024

Hello,

Thanks for asking! In theory it would be a desirable addition. But my gut intuition is that it'll be too much work right now to iterate on this toward a version that's acceptable for core imgui lib so I am not sure I want to take on that cognitive load right now.

I would however always encourage you to try extracting/separating the code, into e.g. its own file (or even project) if you can.
Then we can link it from https://github.com/ocornut/imgui/wiki/Useful-Extensions to increase visibility and likelihood of it being used by other people.

Flix01 repo (https://github.com/Flix01/imgui/wiki/ImGui-Addons-Branch-Home) which is rather old had one.
But until right one I didn't think there was another.. and I just googled "imgui date picker" now and found one which looks good: https://github.com/DnA-IntRicate/ImGuiDatePicker so there's that.

@ozlb
Copy link

ozlb commented Nov 19, 2024

In implot there is a neat implementation of both date and time picker

@Brotcrunsher
Copy link
Contributor Author

Thanks for the feedback! :)
Question is answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants