Reputation: 49
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var BFolder = "C:\\temp";
var XFolder = FSO.GetFolder(BFolder+"\\");
var FList = new Enumerator(XFolder.Files);
var today = new Date();
for (; !FList.atEnd(); FList.moveNext()) {
var d = FList.item().DateLastModified;
if (d.getMonth() == today.getMonth) { // <----- *
}
else {
}
}
How do I make the above comparison (*) work?
Upvotes: 0
Views: 702
Reputation: 736
You should probably use today.getMonth()
in stead of today.getMonth
And perhaps replace
var d = FList.item().DateLastModified;
by
var d = new Date(FList.item().DateLastModified);
Upvotes: 2
Reputation: 21763
Assuming d
is a Date
object you can compare months this way:
if (d.getMonth() == today.getMonth()) { …
(you need to call Date.getMonth
).
Upvotes: 0