add:    this.useLongDateService = true; try { var longProbeString = this.getLongFormatedDate(probeDate);    if (longProbeString == null || longProbeString.length < 4 || longProbeString == probeString) this.useLongDateService = false; } catch (error) { this.useLongDateService = false; } 
context: function DateFormater( ){  // we get the date bundle in case the locale changes, can  // we be notified of a locale change instead, then we could  // get the bundle once.  this.dateStringBundle = srGetStrBundle("chrome://calendar/locale/dateFormat.properties");  // probe the dateformat    this.yearIndex = -1;  this.monthIndex = -1;  this.dayIndex = -1;  this.twoDigitYear = false;  this.alphaMonths = null;  this.probeSucceeded = false;    // SHORT NUMERIC DATE, such as 2002-03-04, 4/3/2002, or CE2002Y03M04D.  // Made of digits & nonDigits.  [^\d\W]* is letters-only optional prefix   // for era, as in CE2002Y03M04D, used in chinese short dates to distinguish   // western Common-Era year from year in chinese calendar.  var parseShortDateRegex = /^\s*[^\d\W]*(\d+)\D(\d+)\D(\d+)\D?\s*$/;  var probeDate = new Date(2002,3-1,4); // month is 0-based  var probeString = this.getShortFormatedDate(probeDate);  var probeArray = parseShortDateRegex.exec(probeString);  if (probeArray != null) {     // Numeric month format    for (var i = 1; i <= 3; i++) {       switch (Number(probeArray[i])) {        case 02:    this.twoDigitYear = true; // fall thru        case 2002:  this.yearIndex = i;       break;        case 3:     this.monthIndex = i;      break;        case 4:     this.dayIndex = i;        break;      }    }    //All three indexes are set (not -1) at this point.    this.probeSucceeded = true;  } else {    // SHORT DATE WITH ALPHABETIC MONTH, such as "dd MMM yy" or "MMMM dd, yyyy"    // (\d+|[^\d\W]) is digits or letters, not both together.    // Allows 31dec1999 (no delimiters between parts) if OS does (w2k does not).    // Allows Dec 31, 1999 (comma and space between parts)    parseShortDateRegex = /^\s*(\d+|[^\d\W]+)\W{0,2}(\d+|[^\d\W]+)\W{0,2}(\d+|[^\d\W]+)\s*$/;    probeArray = parseShortDateRegex.exec(probeString);    if (probeArray != null) {      for (var j = 1; j <= 3; j++) {         switch (Number(probeArray[j])) {          case 02:    this.twoDigitYear = true; // fall thru          case 2002:  this.yearIndex = j;       break;          case 4:     this.dayIndex = j;        break;          default:    this.monthIndex = j;      break;        }      }      if (this.yearIndex != -1 && this.dayIndex != -1 && this.monthIndex != -1) {        this.probeSucceeded = true;        // Fill this.alphaMonths with month names.        this.alphaMonths = new Array(12);        for (var m = 0; m < 12; m++) {          probeDate.setMonth(m);          probeString = this.getShortFormatedDate(probeDate);          probeArray = parseShortDateRegex.exec(probeString);          if (probeArray != null)             this.alphaMonths[m] = probeArray[this.monthIndex].toUpperCase();          else            this.probeSucceeded = false;        }      }    }    if (! this.probeSucceeded)      dump("\nOperating system short date format is not recognized: "+probeString+"\n");  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/2d580407a73c80f478d6882f5a417635e73d30ef/dateUtils.js/clean/calendar/resources/content/dateUtils.js