I just installed this plugin and it's quite neat, but thought that adding the ability to display future or past dates would be beneficial too.
Being javascript it's easy to change the plugin, so I added the following before the script formats the date:
var NewDate = new Date() // Get current Date
if (querynokeyword != "") {
// Why is querynokeyword always just the first word??
var arrayOfQuery = queryraw.split(" ");
for (var i=1; i < arrayOfQuery.length; i++) {
if (IsNumeric(arrayOfQuery[i]) == true ) {
var ip = i + 1;
if (ip < arrayOfQuery.length ) {
switch(arrayOfQuery[ip].toLowerCase()) {
case "year":
case "yyyy": {// year
NewDate.setFullYear(NewDate.getFullYear() + parseFloat( arrayOfQuery[i]));
break;
}
case "quarter":
case "q": { // quarter
NewDate.setMonth(NewDate.getMonth() + (parseFloat( arrayOfQuery[i])*3));
break;
}
case "month":
case "m": { // month
NewDate.setMonth(NewDate.getMonth() + parseFloat( arrayOfQuery[i]));
break;
}
case "day":
case "y": // day of year
case "d": // day
case "w": { // weekday
NewDate.setDate(NewDate.getDate() + parseFloat( arrayOfQuery[i]));
break;
}
case "week":
case "ww": { // week of year
NewDate.setDate(NewDate.getDate() + (parseFloat( arrayOfQuery[i])*7));
break;
}
case "hour":
case "h": { // hour
NewDate.setHours(NewDate.getHours() + parseFloat( arrayOfQuery[i]));
break;
}
case "minute":
case "n": { // minute
NewDate.setMinutes(NewDate.getMinutes() + parseFloat( arrayOfQuery[i]));
break;
}
case "second":
case "s": { // second
NewDate.setSeconds(NewDate.getSeconds() + parseFloat( arrayOfQuery[i]));
break;
}
case "milliseconds":
case "ms": { // second
NewDate.setMilliseconds(NewDate.getMilliseconds() + parseFloat( arrayOfQuery[i]));
break;
}
}
}
}
}
}
Works fine, but it raised some questions about Licensing: There was not a Licence defined in the file or on his website, so I'm not sure if I should have done that or not?
I wonder if we:
- Should ensure that all Plugins have some sort of Licence attached to them?
- Should have an area for Open Source plugins, especially the FScript variety, as they are so easy to change?

What do people think?