");
/* Month with link to calendar */
fprintf (Gbl.F.Out,"
");
Frm_StartForm (ActSeeCal);
Frm_LinkFormSubmit (Txt_Show_calendar,"CURRENT_MONTH",NULL);
fprintf (Gbl.F.Out,"" // JavaScript will write HTML here
""
"");
Frm_EndForm ();
fprintf (Gbl.F.Out,"
");
/* Day with link to agenda (if I am logged) */
fprintf (Gbl.F.Out,"
");
if (Gbl.Usrs.Me.Logged)
{
Frm_StartForm (ActSeeMyAgd);
Frm_LinkFormSubmit (Txt_Show_agenda,"CURRENT_DAY",NULL);
}
fprintf (Gbl.F.Out,"" // JavaScript will write HTML here
"");
if (Gbl.Usrs.Me.Logged)
{
fprintf (Gbl.F.Out,"");
Frm_EndForm ();
}
fprintf (Gbl.F.Out,"
");
/* Time */
fprintf (Gbl.F.Out,"
" // JavaScript will write HTML here
"
");
/* End container */
fprintf (Gbl.F.Out,"
");
/* Write script to draw the month */
fprintf (Gbl.F.Out,"",
(long) Gbl.StartExecutionTimeUTC);
}
/*****************************************************************************/
/***************** Compute local time, adjusting day of week *****************/
/*****************************************************************************/
struct tm *Dat_GetLocalTimeFromClock (const time_t *timep)
{
struct tm *tm_ptr;
if ((tm_ptr = localtime (timep)) == NULL)
Lay_ShowErrorAndExit ("Can not get local time from clock.");
/***** Convert from sunday, monday, tuesday...
to monday, tuesday, wednesday... *****/
if (tm_ptr->tm_wday == 0) // sunday
tm_ptr->tm_wday = 6;
else if (tm_ptr->tm_wday >= 1 &&
tm_ptr->tm_wday <= 6) // monday to saturday
tm_ptr->tm_wday--;
else // error!
tm_ptr->tm_wday = 0;
return tm_ptr;
}
/*****************************************************************************/
/********* Convert a struct with Day, Month and Year to a date string ********/
/*****************************************************************************/
void Dat_ConvDateToDateStr (struct Date *Date,char StrDate[Cns_MAX_BYTES_DATE + 1])
{
extern const char *Txt_MONTHS_SMALL_SHORT[12];
if (Date->Day == 0 ||
Date->Month == 0 ||
Date->Year == 0)
StrDate[0] = '\0';
else
switch (Gbl.Prefs.DateFormat)
{
case Dat_FORMAT_YYYY_MM_DD:
snprintf (StrDate,Cns_MAX_BYTES_DATE + 1,
"%04u-%02u-%02u",
Date->Year,
Date->Month,
Date->Day);
break;
case Dat_FORMAT_DD_MONTH_YYYY:
snprintf (StrDate,Cns_MAX_BYTES_DATE + 1,
"%u %s %04u",
Date->Day,
Txt_MONTHS_SMALL_SHORT[Date->Month - 1],
Date->Year);
break;
case Dat_FORMAT_MONTH_DD_YYYY:
snprintf (StrDate,Cns_MAX_BYTES_DATE + 1,
"%s %u, %04u",
Txt_MONTHS_SMALL_SHORT[Date->Month - 1],
Date->Day,
Date->Year);
break;
}
}
/*****************************************************************************/
/*************** Show forms to enter initial and ending dates ****************/
/*****************************************************************************/
void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (bool SetHMS000000To235959)
{
extern const char *The_ClassFormInBox[The_NUM_THEMES];
extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME];
extern const char *Txt_Yesterday;
extern const char *Txt_Today;
Tbl_StartRow ();
/***** Start date-time *****/
Tbl_StartCellAttr ("class=\"RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"