pickachu icon indicating copy to clipboard operation
pickachu copied to clipboard

Datetime picker

Open akrejczinger opened this issue 4 years ago • 2 comments

As far as I can tell, currently only dates can be selected, datetimes are not possible. This makes the hour, minute, seconds etc. formatting options useless. Am I missing something? Could this be added?

akrejczinger avatar Apr 07 '20 08:04 akrejczinger

After some further google search it seems Zenity doesn't support this, so it may be harder than I thought. Is there an alternative library to Zenity with a good datetime picker?

akrejczinger avatar Apr 07 '20 08:04 akrejczinger

You can check out apps.py and add your own custom datetime picker app. Pretty easy to add a new, custom app.

Ex.

'datetime': {
    'cmd': 'python',
    'options': [
        '-c "import datetime; print(datetime.datetime.now())"',
    ]
}

..prints the current datetime.

OR

'datetime': {
    'cmd': 'python /path/to/my-datetime-picker.py',
    'options': [
    ]
},

..runs your own custom script to do whatever and print a datetime.

Your challenge would be figuring out how to display a GUI datetime dialog. Without installing any sort of additional Python packages, you may be able to achieve this in Tkinter. If you want a Gtk GUI, there's a Python library for that. Same for Qt. I think it would be easiest with Qt. Example.

DougBeney avatar Apr 07 '20 14:04 DougBeney