[Composite Datasource]: Date Handling Java Scripts

Some sample script for DateHandling:

Date.js
 
function getMonth(Date)
{
 return Date.getMonth();
}
function getYear(Date)
{
 return Date.getYear();
}

function getFullYear(Date)
{
 return Date.getFullYear();
}

function getQuarter(Date)
{
 switch (Date.getMonth())
 {
  case >8: return 1;
  case >5: return 2;
  case >2: return 3;
  default: return 4;
 }
}

function getDate(Date)
{
 return Date.getDate();
}

function getDay(Date)
{
 return Date.getDay();
}

function getFullDay(Date)
{
 switch (Date.getDay())
 {
  case 0: return "Sunday";
  case 1: return "Monday";
  case 2: return "Tuesday";
  case 3: return "Wednesday";
  case 4: return "Thursday";
  case 5: return "Friday";
  case 6: return "Saturday";
  default: return "";
 }
}

function getHours(Date)
{
 return Date.getHours();
}

function getMinutes(Date)
{
 return Date.getMinutes();
}

function getSeconds(Date)
{
 return Date.getSeconds();
}