ITrack/Date Fields

From ISoft Wiki
Jump to: navigation, search

Most places in ITrack where dates need to be entered there exist special Date Controls. These objects have a drop down calendar and are specially designed to help people view dates visually. Some places, however, there is either little room for a large date control or for other design reasons a simple edit box is used. Even though the edit boxes aren't as visually appealing, they are still very powerful and efficient.

Date edits in ITrack can parse a large number of possible formats.

Absolute Dates

Absolute dates are precise dates. ITrack supports two formats:

  • American Format - This is the standard American 'mm/dd/yyyy' format. ITrack supports just typing in the month/day part or even just the day part. The year can be entered as a two digit or four digit number. If a single number is entered and it is four digits, it is treated as a year. If that number is followed by a dash and two digits then it is a year and a month. This can be useful when used with relative dates.

International Format - This is a format used by many nations 'dd.mm.yyyy'. Years may be two or four digits. If only four digits are entered, it is treated as a year.

  • SQL Format - This is a the commonly used computer format 'yyyy-mm-dd'. ITrack supports just typing in the month-day part of even just the day part. The year can be entered as a two digit or four digit number.

Relative Dates

The flexibility of the date system is greatly enhanced by the allowance of relative dates. A relative date can be entered on its own (in which case it will be relative to the current date) or it can be inputted following an absolute date. Relative dates can be in many formats:

  • "<+/->n <period>" - The plus or minus tells whether to add or subtrack, the number n represents an integer, and the <period> can be any of "days", "weeks", "months", or "years" or simply their first letters "d", "w", "m", and "y". The period is case insensitive and the pluralization is optional. Some examples:
    • "+5 weeks" - Five weeks from now
    • "-1 year" - Last year
    • "+12w" - Twelve weeks from now
    • "12/25/1985 +60d" - Sixty days after Christmas in 1985
    • "3 -7" - Seven days before the third of this month
  • "[<modifier>] <day of week>" - By day of the week. <modifier> is optional one of the words "this", "last", or "next" and is case insensitive. <day of week> can be "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" or their usual shorter forms "Su(n)", "Mo(n)", "Tu(es)", "We(d)", "Th(urs)", "Fr(i)", "Sa(t)". It is case insensitive. If a plus or minus and a number is placed before the day of the week then ITrack interprets it as that man <day of week>s ago. If no number is used then ITrack assumes that the day listed is the day of the current week (even if it has passed or is yet to come). Weeks in ITrack begin on Sunday and end on Saturday. Some examples:
    • "Th" - The Thursday of this week.
    • "next sat" - The Saturday of the next week
    • "4/1 Mon" - The Monday in the week of April first.
    • "1976-06-04 Sunday" - The Sunday of the week 200 years after the the United States declared their independence.
  • "[<+/->]n <day of the week>" - Days of the week can also added, subtracted or enumerated according to their order in the month. If they are being added or subtracted, use a plus or minus sign. If specifying directly, omit the sign and use the numerals 1-5 or the words "first", "second", "third", "fourth", or "fifth".
    • "-1 Friday" - The Friday of the previous week
    • "second Thursday" - The second Thursday of the month
    • "2001 3 Sun" - The third Sunday of the year 2001
    • "+5 Sa" - Five Saturdays after the one this week.
    • "01.11.08 4 Thurs" - American Thanksgiving day (the fourth Thursday of the month of November) of 2008.
  • "<special>" There are a few special strings that ITrack recognizes. While there is generally no good reason to, they can be appended to absolute dates. They are case insensitive:
    • "today" - Today
    • "tomorrow" - Tomorrow
    • "yesterday" - Yesterday