Forum Discussion
tristaanogre
7 years agoEsteemed Contributor
So, you're checking to see if the text box contains the current date, is that correct?
Well, I'm assuming the text box has some sort of property like "text" or "wText" or something like that. You know the date is formatted as MM/DD/YYYY so, this is what I propose.
var currentDate = aqConvert.DateTimetoFormatStr(aqDateTime.Today(), '%m/%d/%Y'); if (myTextBox.wText === currentDate) { Log.Message('They match'); } else { Log.Error('The dates do not match'); }
Alternatively, if you're using KeywordTests, you COULD do a properyCheckpoint on that propery and set the value that you are checking to a code expression of
aqConvert.DateTimetoFormatStr(aqDateTime.Today(), '%m/%d/%Y')
- kevinkleint7 years agoContributor
Hi!
I thought about it a little bit and figured it out. This was the code I used. Thanks for your input though!
function showPresentDate() { dt = new Date(); //Gets today's date right now (to the millisecond). month = dt.getMonth()+1; day = dt.getDate(); year = dt.getFullYear(); presentdate = month + '/' + day + '/' + year; aqObject.CheckProperty(Aliases.ceraexe0.dlgServices.EditReceived, "wText", cmpEqual, presentdate); }
Kevin Kleint
Related Content
- 8 years agoilovechiku
- 10 months agoesoysal
- 3 years agogdave
Recent Discussions
- 3 hours agoSvetaG