DateToStrPt and DateToStrPtBr
Posted: Wed Jan 08, 2014 12:43 am
I share with you two new missing functions to convert a date to the string representation in both Portuguese-Portuguese (European) and Portuguese-Brazilian (It would be nice to have these functions available in the next build, preventing to add additional fields just to format before handing the report):
Code: Select all
private function DateToStrPtBr(value:Date):String
{
return DateToStrPt(value).toLowerCase();
}
private function DateToStrPt(value:Date):String
{
var month:String = null;
switch (value.month)
{
case 0:
month = "Janeiro";
break;
case 1:
month = "Fevereiro";
break;
case 2:
month = "Março";
break;
case 3:
month = "Abril";
break;
case 4:
month = "Maio";
break;
case 5:
month = "Junho";
break;
case 6:
month = "Julho";
break;
case 7:
month = "Agosto";
break;
case 8:
month = "Setembro";
break;
case 9:
month = "Outubro";
break;
case 10:
month = "Novembro";
break;
default:
month = "Dezembro";
break;
}
return value.date + " de " + month + " de " + value.fullYear;
}