From RPM Wiki

Table of contents

Summary

There are various places in RPM where dates and times are entered & displayed. This page covers the formatting rules for input and display.

  • Anytime a date is put into RPM it is manipulated into a standard timestamp format.
  • Anytime a date is displayed in RPM it is formatted into a standard format.

Input

UI

When the users enters a date by clicking on the date picker, we know the date format is correct as it follows the display rules below. However, when the user types or pastes a date it could be any format. RPM will parse the date according to the browsers Javascript date parsing rules, which generaly behave as expected. There is one exception that RPM will look for, and that is dates in the mm/dd/yy fomat. In this case we need to make sure that 2 digit years are changed to our century as most browsers use 1900's.

Test cases

When the string on the left is typed in it should be changed automatically to the string on the right after leave the field (tab or click) or hit enter. Note that our JavaScript uses the browser's built-in date functionality as much as possible. That means every browser will be different. Example: 1 digit years will fail in Opera yet work in IE, Safari, and Firefox.

  • "1/02/03" = "Jan 02, 2003"
  • " 1/02/03" = "Jan 02, 2003"
  • "1/02/03 " = "Jan 02, 2003"
  • "01/02/03" = "Jan 02, 2003"
  • "1/2/2003" = "Jan 02, 2003"
  • "1/2/1903" = "Jan 02, 1903"
  • "1/2/2103" = "Jan 02, 2103"
  • "1-02-03" = "Jan 02, 2003"
  • "1-02-03" = "Jan 02, 2003"
  • " 1-02-03" = "Jan 02, 2003"
  • "01-02-03" = "Jan 02, 2003"
  • "1-2-2003" = "Jan 02, 2003"
  • "1-2-1903" = "Jan 02, 1903"
  • "1-2-2103" = "Jan 02, 2103"
  • "January 2, 2003" = "Jan 02, 2003"

The following strings will be parsed as invalid and the field blanked out

  • "abcdef"
  • "123456"
  • "13/2/3" (except in IE where it 'wraps' and becomes "Jan 02, 2004")
  • "1/32/3" (except in IE where it 'wraps' and becomes "Feb 01, 2003")

RPM will do it's best to parse the user's date so that the widest range of formats will be read correctly. The preferred method of date entry is with the RPM Calendar control

Import

The importer reads the raw date from Excel so you could say the importer follows the Excel date parsing rules.

Display

Formatting.

Date only, short

Use this inside grid cells or other places where space is tight.

  • Example: "Jan 1, 2002"

Date only, long

If there is room, use this format

  • Example: "Tue, Jan 1, 2002"

Relative

For both the short and long format replace the date with "Yesterday", "Today", or "Tomorrow" if applicable.

  • Example: "Today"
  • This is for on-screen display in RPM only, do not do this in downloads

Time only

RPM uses a 12 hour clock. If the date and time are displayed together, the time is first.

  • Example: "12:03 PM"
  • Example: "12:03 PM Tue, Jan 1, 2002
  • Example: "12:03 PM Yesterday"
  • This page was last modified 15:42, 22 Jun 2009.
  • This page has been accessed 588 times.