Class PTDate

Object
   |
   +--PTDate

class PTDate


A useful wrapper class around Date objects. Also contains static methods for manipulating Dates.

Usage:	
 	var ptd = new PTDate('', new Date(), 'en');
 	ptd.incrementMonth();
 	PTDate.get2DigitMinutes(new Date());
 

Defined in PTUtil.js

Requires:


Field Summary
 Date date
          The underlying Date object
<static>  <final> String DEFAULT_LOCALE
          The Default locale constant.
<static>  String defaultDateFormat
          Date format used as default for all new PTDate objects.
<static>  String defaultLanguage
          Language used as default for all new PTDate objects.
<static>  <final> Number FORMAT_DEFAULT
          Default date format constant
<static>  <final> Number FORMAT_FULL
          Full date format constant
<static>  <final> Number FORMAT_LONG
          Long date format constant
<static>  <final> Number FORMAT_MEDIUM
          Medium date format constant
<static>  <final> Number FORMAT_SHORT
          Short date format constant
<static>  <final> Number TIME_POLICY_ALLOW_TIMES
          Allow times time-policy constant
<static>  <final> Number TIME_POLICY_FORBID_TIMES
          Forbid times time-policy constant
<static>  <final> Number TIME_POLICY_REQUIRE_TIMES
          Require times time-policy constant
<static>  <final> Object VERSION
          
 
Constructor Summary
PTDate (datestring,date,language,dateFormat)
            PTDate Object constructor
 
Method Summary
 Object clone()
           Returns a (by value) copy of this object.
 String format(dateFormat,language)
           Generate a custom-formatted string from a PTDate
This function uses the same formatting codes as Java date formats.
Eg: EEE MMM d HH:mm:ss yyyy
yields: Mon Feb 7 08:30:00 2003
 Number getNumberOfDaysInThisMonth()
           Returns the number of days in the month of the internal date object
 Number getTime()
           wrapper method for Date.getTime() method
 Boolean hasTime()
           Determines whether or not a PTDate object has a specific time associated with the date, or if its specificity is limited to the day level or greater.
 void incrementDay()
           Increments the internal date object by one day
 void incrementMonth()
           Increments the month of the internal date object
 void incrementWeek()
           Increments the internal date object by one week
<static> String convert2DigitTo4DigitYear(year)
           Convert a 2-digit to a 4-digit year, subject to pivot date
<static> String formatDate(date,dateFormat,language)
           Format a Date object
<static> String get1Digit0To11Hour(date)
           Get hour in 1-digit form, range 0 to 11
<static> String get1Digit1To12Hour(date)
           Get hour in 1-digit form, range 1 to 12
<static> String get1Digit1To24Hour(date)
           Get hour in 1-digit form, range 1 to 24
<static> String get1DigitDayOfMonth(date)
           Get date of month in 1-digit form
<static> String get1DigitMinutes(date)
           Get minutes in 1-digit form
<static> String get1DigitMonth(date)
           Get month in 1-digit form
<static> String get1DigitSeconds(date)
           Get seconds in 1-digit form
<static> String get2Digit0To11Hour(date)
           Get hour in 2-digit form, range 0 to 11
<static> String get2Digit0To23Hour(date)
           Get hour in 2-digit form, range 0 to 23
<static> String get2Digit1To12Hour(date)
           Get hour in 2-digit form, range 1 to 12
<static> String get2Digit1To24Hour(date)
           Get hour in 2-digit form, range 1 to 24
<static> String get2DigitDayOfMonth(date)
           Get date of month in 2-digit form
<static> String get2DigitMinutes(date)
           Get minutes in 2-digit form
<static> String get2DigitMonth(date)
           Get month in 2-digit form
<static> String get2DigitSeconds(date)
           Get seconds in 2-digit form
<static> String get2DigitYear(date)
           get2DigitYear Get year in 2-digit form
<static> String get3DigitMilliseconds(date)
           Get milliseconds in 3-digit form
<static> String getAMPM(date,language)
           Get AM/PM string for date, internationalized
<static> Number getNumberOfDaysInMonth(date)
           Returns the number of days in the month of a given date
<static> Boolean isLeapYear(year)
           Is a given year a leap year?
<static> String validateAndFormatDate(dateString, outputFormat, locale, alertOnFailure, timePolicy, formatList)
           Validate a string to determine if it is a valid date, and if so format it to a desired format
<static> Boolean validateDate(dateString, locale, alertOnFailure, timePolicy, formatList)
           Validate a string to determine if it is a valid date

Field Detail

date

Date date

DEFAULT_LOCALE

<static> <final> String DEFAULT_LOCALE

defaultDateFormat

<static> String defaultDateFormat

defaultLanguage

<static> String defaultLanguage

FORMAT_DEFAULT

<static> <final> Number FORMAT_DEFAULT

FORMAT_FULL

<static> <final> Number FORMAT_FULL

FORMAT_LONG

<static> <final> Number FORMAT_LONG

FORMAT_MEDIUM

<static> <final> Number FORMAT_MEDIUM

FORMAT_SHORT

<static> <final> Number FORMAT_SHORT

TIME_POLICY_ALLOW_TIMES

<static> <final> Number TIME_POLICY_ALLOW_TIMES

TIME_POLICY_FORBID_TIMES

<static> <final> Number TIME_POLICY_FORBID_TIMES

TIME_POLICY_REQUIRE_TIMES

<static> <final> Number TIME_POLICY_REQUIRE_TIMES

VERSION

<static> <final> Object VERSION

Constructor Detail

PTDate

PTDate(datestring,date,language,dateFormat)

Method Detail

clone

Object clone()

format

String format(dateFormat,language)

getNumberOfDaysInThisMonth

Number getNumberOfDaysInThisMonth()

getTime

Number getTime()

hasTime

Boolean hasTime()

incrementDay

void incrementDay()

incrementMonth

void incrementMonth()

incrementWeek

void incrementWeek()

convert2DigitTo4DigitYear

<static> String convert2DigitTo4DigitYear(year)

formatDate

<static> String formatDate(date,dateFormat,language)

get1Digit0To11Hour

<static> String get1Digit0To11Hour(date)

get1Digit1To12Hour

<static> String get1Digit1To12Hour(date)

get1Digit1To24Hour

<static> String get1Digit1To24Hour(date)

get1DigitDayOfMonth

<static> String get1DigitDayOfMonth(date)

get1DigitMinutes

<static> String get1DigitMinutes(date)

get1DigitMonth

<static> String get1DigitMonth(date)

get1DigitSeconds

<static> String get1DigitSeconds(date)

get2Digit0To11Hour

<static> String get2Digit0To11Hour(date)

get2Digit0To23Hour

<static> String get2Digit0To23Hour(date)

get2Digit1To12Hour

<static> String get2Digit1To12Hour(date)

get2Digit1To24Hour

<static> String get2Digit1To24Hour(date)

get2DigitDayOfMonth

<static> String get2DigitDayOfMonth(date)

get2DigitMinutes

<static> String get2DigitMinutes(date)

get2DigitMonth

<static> String get2DigitMonth(date)

get2DigitSeconds

<static> String get2DigitSeconds(date)

get2DigitYear

<static> String get2DigitYear(date)

get3DigitMilliseconds

<static> String get3DigitMilliseconds(date)

getAMPM

<static> String getAMPM(date,language)

getNumberOfDaysInMonth

<static> Number getNumberOfDaysInMonth(date)

isLeapYear

<static> Boolean isLeapYear(year)

validateAndFormatDate

<static> String validateAndFormatDate(dateString, outputFormat, locale, alertOnFailure, timePolicy, formatList)

validateDate

<static> Boolean validateDate(dateString, locale, alertOnFailure, timePolicy, formatList)


Documentation generated by JSDoc on Wed Aug 24 10:17:38 2005