Skip to content

Instantly share code, notes, and snippets.

@tdalon
Last active July 20, 2023 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdalon/6bd98a36ee20a978c4d76ca975b2a656 to your computer and use it in GitHub Desktop.
Save tdalon/6bd98a36ee20a978c4d76ca975b2a656 to your computer and use it in GitHub Desktop.
Universal Date Picker for Windows implemented with AutoHotkey
; Ctrl+,
^,:: ; CurrentDate
FormatTime, CurrentDateTime,, yyyy-MM-dd
SendInput %CurrentDateTime%
return
; Ctrl+.
^.:: ; DatePicker
DatePicker(sDate)
If !sDate ; empty= cancel
return
FormatTime, sDate, %sDate%, yyyy-MM-dd
SendInput %sDate%
return
; ----------------------- SUBFUNCTIONS -------------------------------
DatePicker(ByRef DatePicker){
Gui, +LastFound
gui_hwnd := WinExist()
Gui, Add, MonthCal, 4 vDatePicker
Gui, Add, Button, Default , &OK
Gui Add, Button, x+0, Cancel
Gui, Show , , Date Picker Calendar
WinWaitClose, AHK_ID %gui_hwnd%
return
ButtonOK:
Gui, submit ;, nohide
Gui, Destroy
;Gui, Hide
return
GuiEscape:
ButtonCancel:
GuiClose:
DatePicker := ""
Gui, Destroy
return
}
@tdalon
Copy link
Author

tdalon commented Jul 29, 2022

@bigbadplayer
Copy link

Hello @tdalon,
I would like to thank you for this script. I used it many-many times, and recently forked it for my own needs: DatePickerGO.
I've also mentioned your script, as a base of mine app. Thank you again!

@tdalon
Copy link
Author

tdalon commented Jul 18, 2023

@bigbadplayer you're welcome! Many thanks for the feedback. Your app looks like more than a fork but a great extension.
You might want to look at my PowerTools for packaging it with Settings for AutoStart and changing the Hotkey

@bigbadplayer
Copy link

Thank you for the tip! I've just released some new features; but the next goal is a gui for settings, instead of direct edit of ini file. Your work is inspires and give great examples.

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