Eric24
21 May 2008, 12:53 PM
An idea...If it's out there, maybe I'm not looking in the right way...
A date format that would be very useful is one that returns "Yesterday", "Today", and "Tomorrow" (and even "Overmorgen", a special word in Danish and other Nordic languages that means "the day after tomorrow"), a date without the year for any dates in the current year, and an otherwise "full" date otherwise; it should also be accompanied by an option to include time in a specified format. This is similar to the posting timestamps that appear in the forums and is used in several email clients. The point to it is that "Yesterday" is more instantly intuitive than a date, and the time something occurred is less relevant the longer ago it was (at least in a list of events).
Of course, text for each of these "near" possibilities and formatting strings for "this year" and "other year" dates would be configs to allow for localization. It's almost an encapsulation of three date/time formatting strings, the one selected being based on the passed date's relationship to "now" (which could be optionally passed if the app didn't want to use "true now").
Examples of possible output:
1) Date=Now @ 10:10: Today 10:10
2) Date=Yesterday @ 8:15: Yesterday 08:15
3) Date=Two Months Ago w/o time: March 22
4) Date=Last Year w/o time: August 15, 2007
A date format that would be very useful is one that returns "Yesterday", "Today", and "Tomorrow" (and even "Overmorgen", a special word in Danish and other Nordic languages that means "the day after tomorrow"), a date without the year for any dates in the current year, and an otherwise "full" date otherwise; it should also be accompanied by an option to include time in a specified format. This is similar to the posting timestamps that appear in the forums and is used in several email clients. The point to it is that "Yesterday" is more instantly intuitive than a date, and the time something occurred is less relevant the longer ago it was (at least in a list of events).
Of course, text for each of these "near" possibilities and formatting strings for "this year" and "other year" dates would be configs to allow for localization. It's almost an encapsulation of three date/time formatting strings, the one selected being based on the passed date's relationship to "now" (which could be optionally passed if the app didn't want to use "true now").
Examples of possible output:
1) Date=Now @ 10:10: Today 10:10
2) Date=Yesterday @ 8:15: Yesterday 08:15
3) Date=Two Months Ago w/o time: March 22
4) Date=Last Year w/o time: August 15, 2007