Forum Discussion
jose_pita
11 years agoSuper Contributor
function date(){
var currentDate = new Date()
var day = currentDate.getDate()
var month = currentDate.getMonth()+1
if(day<=9)
day="0"+day;
if(month<=9)
month="0"+month;
var year = currentDate.getFullYear()
Project.Variables.todaysDate=day + "." + month + "." + year;
Project.Variables.begginingOfTheYear="01.01." + year;
Project.Variables.endOfTheYear="30.12." + year;
Project.Variables.oneYearAgo=day + "." + month + "." + (year-1);
Project.Variables.oneYearMore=day + "." + month + "." + (year+1);
if( month>=2)
{
if(month<=10)
{
Project.Variables.oneMonthMore=day + ".0" + (month-1) + "." + year;
// Log.Message("oneMonthMore: "+Project.Variables.oneMonthMore);
}
else
{
Project.Variables.oneMonthMore=day + "." + (month-1) + "." + year;
// Log.Message("oneMonthMore: "+Project.Variables.oneMonthMore);
}
}
else
{
Project.Variables.oneMonthMore=day + ". 12 ." + (year-1);
// Log.Message("January oneMonthMore: "+Project.Variables.oneMonthMore);
}
if(day===1)
{
if(month===1)
Project.Variables.oneMonthMoreAndOneDay = 30+ "." + 12+ "."+ (year-1);
Project.Variables.oneMonthMoreAndOneDay = 30+ "." + (month-1)+ "."+ year;
}
else
{
if(month<=10)
Project.Variables.oneMonthMoreAndOneDay = (day -1)+ ".0" + (month-1)+ "."+ year;
}
}
function getDateX_days_Before(n)
{
var DateTimeString;
DateTimeString = aqDateTime.Today();
DataTemp = aqDateTime.AddDays(DateTimeString, -n);
DataTemp = aqConvert.DateTimeToFormatStr(DataTemp, "%d.%m.%Y");
Log.Message(DataTemp);
return DataTemp;
}
function getDateX_days_After(n)
{
var DateTimeString;
DateTimeString = aqDateTime.Today();
DataTemp = aqDateTime.AddDays(DateTimeString, +n);
DataTemp = aqConvert.DateTimeToFormatStr(DataTemp, "%d.%m.%Y");
Log.Message(DataTemp);
return DataTemp;
}
Related Content
Recent Discussions
- 2 hours ago