Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; Inspired by: http://www.donationcoder.com/forum/index.php?topic=10149.msg78302#msg78302
- ; Last Updated:
- #Persistent
- #SingleInstance, Force
- #NoEnv
- ;#NoTrayIcon
- SetBatchLines, -1
- SetTitleMatchMode, 2 ; partial match
- SetWorkingDir, %A_ScriptDir%
- SendMode, Input
- DetectHiddenWindows, Off ; they're hidden for a reason.
- appname = DateDiff
- appicon = %appname%.ico
- ; Menu stuff
- If Not A_IsCompiled
- IfExist, %A_ScriptDir%\%appicon%
- Menu, Tray, Icon, %A_ScriptDir%\%appicon%
- Gui, Add, MonthCal, vDayStart
- Gui, Add, Button, Default, Check
- Gui, Add, Text, xp+50 yp+5 w150 vDateDiffText, ;test ;blank at first
- Gui, Add, MonthCal, xs vDayEnd
- Gui, Show,, %appname%
- Return
- ButtonCheck:
- Gui, Submit, NoHide
- ;FormatTime, DayPick, %DayStart%, MMMM d, yyyy
- ;Send, %DayStart%
- EnvSub, DayEnd, %DayStart%, days
- If DayEnd = 0
- {
- ;GuiControl, , DateDiffText, DateDiff: %DayEnd%
- GuiControl, , DateDiffText, % "There is " . DayEnd . " difference."
- ;MsgBox % "There is " . DayEnd . " difference."
- }
- Else If DayEnd <> 1
- {
- GuiControl, , DateDiffText, % DayEnd . " days."
- ;MsgBox % DayEnd . " days."
- }
- Else
- {
- GuiControl, , DateDiffText, % DayEnd . " day."
- ;MsgBox % DayEnd . " day."
- }
- Return
- GuiClose:
- GuiEscape:
- ExitApp
- Return
Advertisement
Add Comment
Please, Sign In to add comment