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 Dte2SpaCut(Date dteHor) // Spanish, cuts 1st day, 1st month
//////////////////////////////////////////////////////////////////////////////
{
Real yeaNum = Year(dteHor);
Text yeaTxt = FormatReal(yeaNum, "%.0lf");
Real mthNum = Month(dteHor);
Text mthTxt = DteSpanishMonth[mthNum];
Real dayNum = Day(dteHor);
Text dayTxt = FormatReal(dayNum, "%.0lf");
If(And(EQ(dayNum,1), EQ(mthNum,1)), yeaTxt,
If( EQ(dayNum,1), mthTxt+" de "+yeaTxt,
dayTxt+" de "+mthTxt+" de "+yeaTxt))
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna una fecha en formato español pero eliminando el dia si es el primero
del mes y el día y el mes si es el primero del año.",
Dte2SpaCut);
//////////////////////////////////////////////////////////////////////////////
Antonio.Salmeron construye las páginas y documentos del sitio web antoniosalmeron.con
2015 asolver.com | Aviso legal | XHTML | Δ Θ Ξ | Creative Commons | Mapa y funciones del sitio