Lasso Soft Inc. > Home

[jina_monthName]

Linkjina_monthName
AuthorJolle Carlestam
CategoryDate
Version8.5.x
LicensePublic Domain
Posted08 Jul 2007
Updated17 Dec 2008
More by this author...

Description

This tag is now deprecated. Use date_int instead.
Returns the full month name for a given date. Supported languages are: Danish, Dutch, English, Finnish, French, German, Irish Gaelic, Italian, Norwegian, Portuguese, Spanish, Swedish, Greek, Chinese. Month names are capitalised in the format that's the language standard. For English August is returned as August, for Swedish it's returned as augusti. Returned format can be modified using the optional -case. Supported cases are 'word|sentence|lower|upper'.

Sample Usage

	var:'thismonth' = (jina_monthName: date, -language = 'sv');

	To change case from the language standard use -case:
	var:'thismonth' = (jina_monthName: date, -language = 'sv', -case = 'word|sentence|lower|upper');

Source Code

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.

> #language));
		Fail: 8010, 'Unsupported language: ' + #language;
	/if;

	local:'month'= (#date->Month);

	select:  #language;
		case: 'sv'; // Swedish
			local: 'monthNames'=(Map: 1='januari', 2='februari', 3='mars', 4='april', 5='maj', 6='juni', 7='juli', 8='augusti', 9='september', 10='oktober', 11='november', 12='december');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'da'; // Danish
			local: 'monthNames'=(Map: 1='januar', 2='februar', 3='marts', 4='april', 5='maj', 6='juni', 7='juli', 8='august', 9='september', 10='oktober', 11='november', 12='december');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'de'; // German
			local: 'monthNames'=(Map: 1='Januar', 2='Februar', 3='März', 4='April', 5='Mai', 6='Juni', 7='Juli', 8='August', 9='September', 10='Oktober', 11='November', 12='Dezember');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'el'; // Greek
			local: 'monthNames'=(Map: 1='', 2='', 3='', 4='', 5='', 6='', 7='', 8='', 9='', 10='', 11='', 12='');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'es'; // Spanish
			local: 'monthNames'=(Map: 1='enero', 2='febrero', 3='marzo', 4='abril', 5='mayo', 6='junio', 7='julio', 8='agosto', 9='septiembre', 10='octubre', 11='noviembre', 12='diciembre');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'fi'; // Finnish
			local: 'monthNames'=(Map: 1='tammikuu', 2='helmikuu', 3='maaliskuu', 4='huhtikuu', 5='toukokuu', 6='kesäkuu', 7='heinäkuu', 8='elokuu', 9='syyskuu', 10='lokakuu', 11='marraskuu', 12='joulukuu');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'fr'; // French
			local: 'monthNames'=(Map: 1='janvier', 2='février', 3='mars', 4='avril', 5='mai', 6='juin', 7='juillet', 8='août', 9='septembre', 10='octobre', 11='novembre', 12='décembre');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'ga'; // Irish Gaelic
			local: 'monthNames'=(Map: 1='Eanáir', 2='Feabhra', 3='Márta', 4='Aibreán', 5='Bealtaine', 6='Meitheamh', 7='Iúil', 8='Lúnasa', 9='Meán', 10='Fómhair', 11='Deireadh', 12='Fómhair Samhain Nollaig');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'it'; // Italian
			local: 'monthNames'=(Map: 1='gennaio', 2='febbraio', 3='marzo', 4='aprile', 5='maggio', 6='giugno', 7='luglio', 8='agosto', 9='settembre', 10='ottobre', 11='novembre', 12='dicembre');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'nl'; // Dutch
			local: 'monthNames'=(Map: 1='januari', 2='februari', 3='maart', 4='april', 5='mei', 6='juni', 7='juli', 8='augustus', 9='september', 10='oktober', 11='november', 12='december');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'no'; // Norwegian
			local: 'monthNames'=(Map: 1='januar', 2='februar', 3='mars', 4='april', 5='mai', 6='juni', 7='juli', 8='august', 9='september', 10='oktober', 11='november', 12='desember');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'pt'; // Portuguese
			local: 'monthNames'=(Map: 1='Janeiro', 2='Fevereiro', 3='Março', 4='Abril', 5='Maio', 6='Junho', 7='Julho', 8='Agosto', 9='Setembro', 10='Outubro', 11='Novembro', 12='Dezembro');
			local:'monthName'= #monthNames->(Find: #month);
		case: 'zh'; // Chinese
			local: 'monthNames'=(Map: 1='', 2='', 3='', 4='', 5='', 6='', 7='', 8='', 9='', 10='', 11='', 12='');
			local:'monthName'= #monthNames->(Find: #month);
		case; // Can only be English
			local:'monthName'=(#date->Month: -long);
	/select;

	select: #case;
		case: 'word'; // All words start with a capital: Mars
			#monthName -> titleCase;
		case: 'sentence'; // First word start with a capital: Mars
			#monthName -> lowerCase;
			#monthName -> (ToTitle:1);
		case: 'lower'; // All words in lower case: mars
			#monthName -> lowerCase;
		case: 'upper'; // All words in upper case: MARS
			#monthName -> upperCase;
	/select;

	Return:#monthName;
/Define_Tag;
	
?>

Related Tags

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft