DougBeney / pickachu

The Best Color Picker for Vim! - A Color, Date, and File Chooser for Vim/NeoVim using Zenity
https://dougie.io
MIT License
89 stars 1 forks source link

Datetime picker #11

Open akrejczinger opened 4 years ago

akrejczinger commented 4 years ago

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 commented 4 years ago

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?

DougBeney commented 4 years ago

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.