Using Lasso's date tags are a bit of an arm-wrestling event, and can be very verbose for muti-record lists. The PageBlocks date tags minimize the effort to get dates to display in various formats. They're also much easier to search and replace to allow for style changes. Any valid Lasso date fomat is accepted as input.
Using today's date for a few examples:
fwpDate_euroSlash2 = 04/02/12
fwpDate_euroSlash4 = 04/02/2012
fwpDate_usSlash2 = 02/04/12
fwpDate_usSlash2 = 02/04/12
fwpDate_mmLong = February 04
fwpDate_mmLong4 = February 04, 2012
fwpDate_mmShort = Feb 04
fwpDate_mmshort4 = Feb 04, 2012
Lasso's own valid_date doesn't allow for common date data entry formats nor European formats. PageBlocks allows for dates to be entered in a wide variety of date formats like 24-Apr-2007, 3.5.2006, Apr 15 2006 and many more. Inputs can be forced to be interpreted as US or European formats, or can be flexible to allow for either (with ambiguous ones defaulting to US format).
The fwpDate_age tag calculates age in years (someday I'll add month and day differences as well). Supplying a single date, assume the difference is calculated to the current date, or optionally the second date can be provided to determine age at a given date. The tag accepts any recognized Lasso date format
fwpDate_age: '04/15/1982' = 29 yrs old
fwpDate_age: '2006-01-16' = 6 yrs old
fwpDate_age: -birthdate='2006-01-16', -asofdate='2008-07-06' = 2 yrs old
Adapted from code contributed by Chris Corwin, Doug Burchard, Bil Corry, Greg Willits
Base Date = 01/16/2006 00:00:01
Days between base date and today = 2210
with no extra params
02/03/2012 12:00:00 = Yesterday
02/04/2012 12:00:00 = Today
02/05/2012 00:00:00 = Today
02/06/2012 18:20:30 = Feb 06, 2012
specifing -timeformat='%h:%M:%S'
02/03/2012 12:00:00 = Yesterday
02/04/2012 12:00:00 = Today
02/05/2012 00:00:00 = Today
02/06/2012 18:20:30 = Feb 06, 2012
specifing the formats
02/02/2012 12:00:00 -default='%D' = 02/02/2012
02/03/2012 12:00:00 -yesterdayStr='That's so yesterday!' = That's so yesterday!
02/04/2012 00:00:00 -todayStr='Carpe Diem!' = Carpe Diem!
02/05/2012 18:20:30 -tomorrowStr = 'Manana' = Manana
02/06/2012 2:30 -default='%D' = 02/06/2012
02/06/2012 00:00:00 -todayStr='Carpe Diem!' = February 06, 2012
02/04/2012 00:00:00 -todayStr='Carpe Diem!' = Carpe Diem!
02/06/2012 2:30 -euroSlash4 = 06/02/2012
02/06/2012 2:30 -mmLong4 = February 06, 2012
02/06/2012 2:30 -mmShort4 = Feb 06, 2012
02/04/2012 -mmLong4 = Today
© 2002-2012, pageblocks.org