Link | lp_date_monthLastDay |
Author | Bil Corry |
Category | Date |
Version | 8.x |
License | Public Domain |
Posted | 02 Dec 2005 |
Updated | 02 Dec 2005 |
More by this author... |
Returns the last day of a given month. May specify the month and year either as a [date] or as -month and -year. Omitting the month chooses current month. Omitting the year choose current year.
Note: Requires [lp_date_leapyear]
lp_date_monthlastday: -month=2, -year=2000; returns: 29
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
[ define_tag:'lp_date_monthLastDay', -description='Returns the last day of a given month.', -priority='replace', -optional='date', -optional='month', -optional='year'; local:'month_selected'=(date)->month; local:'year_selected'=(date)->year; // get date if: local_defined:'date' && #date->type == 'date'; #month_selected = #date->month; #year_selected = #date->year; /if; if: local_defined:'month' && (integer:#month) >= 1 && (integer:#month) <= 12; #month_selected = integer:#month; /if; if: local_defined:'year' && (integer:#year) >= 1000 && (integer:#year) <= 9999; #year_selected = integer:#year; /if; select: #month_selected; case: 1; return: 31; case: 2; if: (lp_date_leapyear: #year_selected); return: 29; else; return: 28; /if; case: 3; return: 31; case: 4; return: 30; case: 5; return: 31; case: 6; return: 30; case: 7; return: 31; case: 8; return: 31; case: 9; return: 30; case: 10; return: 31; case: 11; return: 30; case: 12; return: 31; /select; return: 0; // error /define_tag; ]
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Possibly