This is basically a two part question:
1: I am using gui DateTime in a box and then displaying the var with SendInput, %var%. However, it's sending a full date with current time. I tried to follow the help section stating i could use a custom date so i tried:
Gui, 1: Add, DateTime, vMyDate, yyyy-MM-dd
It didn't work. I tried to format time with:
Formattime, Mydate, , yyyy-mm-dd
And that didnt help either. What am I missing?
Part 2 of the question:
In one of the datetime guis I want to add a week to the selected date. I tried
Mydate +:= 7
But that didn't work either. What am I doing wrong?
Thanks!
Johana, Sweden.
Gui DateTime + add 7 days to selected date
Re: Gui DateTime + add 7 days to selected date
Try
or:
and
Code: Select all
Gui, 1: Add, DateTime, vMyDate, %A_Year%-%A_MM%-%A_DD%
Gui, 1: Show
Code: Select all
Formattime, Mydate,, yyyy-mm-dd
Gui, 1: Add, DateTime, vMyDate, %Mydate%
Gui, 1: Show
Code: Select all
today := A_Now
FormatTime, Mydate, %today%, yyyy-MM-dd
today += 7, days
FormatTime, after7days, %today%, yyyy-MM-dd
MsgBox today:`n%Mydate%`n`nafter 7 days:`n%after7days%
Re: Gui DateTime + add 7 days to selected date
Thanks but none of that worked.
I tried this:
And I tried to add your 2 other suggestions to no avail. It's still displaying the complete date with hhmmtt
see image: http://imgur.com/JejZ1k4
When using it's not letting me pick other dates in the calendar.
Any more suggestions?
I tried this:
Code: Select all
today := A_Now
FormatTime, Mydate, %today%, yyyy-MM-dd
today += 7, days
FormatTime, after7days, %today%, yyyy-MM-dd
Formattime, Mydate,, yyyy-mm-dd
#NoEnv
Gui, 1:Add, DropDownList, vDropDownList1 R2 choose1 gToggle, X1|X2
Gui, 1:Add, DropDownList, vDropDownList2 R2 choose1 gToggle, y1|y2
Gui, 1: Add, DateTime, vStartingDate
Gui, 1: Add, DateTime, vMyDate, %MyDate%
Gui, 1:Add, text,, My text1
Gui, 1:Add, edit, vtext1
Gui, 1:Add, text,, My text2
Gui, 1:Add, edit, vtext2
Gui, 1:Add, text, vtX1Y2 Hidden, My text that shows when X1, Y2 is picked
Gui, 1:Add, edit, vX1Y2 Hidden
Gui, 1:Add, Button, gOK Default ,OK
Return
Toggle:
Gui, 1: Submit, NoHide
If (DropDownList1 = "X1") && (DropDownList2 = "y2") {
GuiControl, 1: Show, X1Y2
GuiControl, 1: Show, tX1Y2
} Else {
GuiControl, 1: Hide, X1Y2
GuiControl, 1: Hide, tX1Y2
}
return
OK:
Gui, 1:Submit,NoHide
if (dropdownlist1 = "x1") && (dropdownlist2 = "y1")
{
MsgBox, The %text1% told the rabbit about %text2% and the date is %MyDate% and after 7 days %after7days%
exitapp
}
else if (dropdownlist1 = "x1") && (dropdownlist2 = "y2")
{
MsgBox, The %text1% told the rabbit about %text2% and %x1y2%
exitapp
}
;Gui 1: hide
return
#j::
Gui 1: show,, DropDownGui
return
see image: http://imgur.com/JejZ1k4
When using
Code: Select all
Gui, 1: Add, DateTime, vMyDate, %A_Year%-%A_MM%-%A_DD%
Any more suggestions?
GEV wrote:Tryor:Code: Select all
Gui, 1: Add, DateTime, vMyDate, %A_Year%-%A_MM%-%A_DD% Gui, 1: Show
andCode: Select all
Formattime, Mydate,, yyyy-mm-dd Gui, 1: Add, DateTime, vMyDate, %Mydate% Gui, 1: Show
Code: Select all
today := A_Now FormatTime, Mydate, %today%, yyyy-MM-dd today += 7, days FormatTime, after7days, %today%, yyyy-MM-dd MsgBox today:`n%Mydate%`n`nafter 7 days:`n%after7days%
Who is online
Users browsing this forum: cjsmile999, doodles333, Google [Bot], Lamron750 and 337 guests