Date functions.
//////////////////////////////////////////////////////////////////////////////
// FILE : dte.tol
// AUTHOR : http://www.asolver.com
// PURPOSE : Date functions.
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// CONSTANTS
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set DteSpanishMonth =
[[ "enero", "febrero", "marzo", "abril", "mayo", "junio",
"julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre" ]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Set of spanish months names.",DteSpanishMonth);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// FUNCTIONS
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text Dte2SpaDayMth(Date dteHor) // Spanish day and month
//////////////////////////////////////////////////////////////////////////////
{
Real mthNum = Month(dteHor);
Text mthTxt = DteSpanishMonth[mthNum];
Real dayNum = Day(dteHor);
Text dayTxt = FormatReal(dayNum, "%.0lf");
If(GT(dayNum, 1), dayTxt+" de "+mthTxt,
mthTxt)
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna una fecha en formato de texto español solo el día y el mes.
Si el dia es el primero del mes entonces solo retorna el nombre del mes.",
Dte2SpaDayMth);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text Dte2Spa(Date dteHor) // Spanish
//////////////////////////////////////////////////////////////////////////////
{
Real yeaNum = Year(dteHor);
Text yeaTxt = FormatReal(yeaNum, "%.0lf");
Dte2SpaDayMth(Date dteHor)+" de "+yeaTxt
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna una fecha en formato de texto español, dia, mes y año.
Si el dia es el primero del mes retorna solo el nombre del mes y el año.",
Dte2Spa);
//////////////////////////////////////////////////////////////////////////////
Ediciones.aContracorriente construye las páginas del sitio web edicionesacontracorriente.com
2015 asolver.com | Aviso legal | XHTML | Δ Θ Ξ | Creative Commons | Mapa y funciones del sitio