Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
Not completely sure that this is a bug or is intended behaviour but I had a client who complained and so had to design a fix.
Basically if the first time in a set is "00:00" and the second time is any time after midnight then the first hour's box was blank.
I made a minor change to the OpeningHoursEditor.ascx.cs file that changed the way the times were displayed.
This means that as long as the second time is not "00:00" and the first time is "00:00", the first time will display instead of being a blank box:
This is purely a change in the way the times are displayed and does not affect anything else.
The code change is in the "oh_rptScheduleItems_ItemDataBound" method:
<code>
if (scheduleItem.FirstSet.HourEnd.TotalMinutes != 0) { ((TextBox)e.Item.FindControl("tbHourStart")).Text = !Config.Use12HourClock ? scheduleItem.FirstSet.HourStartString : TimespanHelper.ConvertTo12HourClock(scheduleItem.FirstSet.HourStartString); ((TextBox)e.Item.FindControl("tbHourEnd")).Text = !Config.Use12HourClock ? scheduleItem.FirstSet.HourEndString : TimespanHelper.ConvertTo12HourClock(scheduleItem.FirstSet.HourEndString); } if (scheduleItem.SecondSet.HourEnd.TotalMinutes != 0) { ((TextBox)e.Item.FindControl("tbHourStart2")).Text = !Config.Use12HourClock ? scheduleItem.SecondSet.HourStartString : TimespanHelper.ConvertTo12HourClock(scheduleItem.SecondSet.HourStartString); ((TextBox)e.Item.FindControl("tbHourEnd2")).Text = !Config.Use12HourClock ? scheduleItem.SecondSet.HourEndString : TimespanHelper.ConvertTo12HourClock(scheduleItem.SecondSet.HourEndString); }
</code>
this replaces:
if (scheduleItem.FirstSet.HourStart.TotalMinutes != 0) ((TextBox)e.Item.FindControl("tbHourStart")).Text = !Config.Use12HourClock ? scheduleItem.FirstSet.HourStartString : TimespanHelper.ConvertTo12HourClock(scheduleItem.FirstSet.HourStartString); if (scheduleItem.FirstSet.HourEnd.TotalMinutes != 0) ((TextBox)e.Item.FindControl("tbHourEnd")).Text = !Config.Use12HourClock ? scheduleItem.FirstSet.HourEndString : TimespanHelper.ConvertTo12HourClock(scheduleItem.FirstSet.HourEndString); if (scheduleItem.SecondSet.HourStart.TotalMinutes != 0) ((TextBox)e.Item.FindControl("tbHourStart2")).Text = !Config.Use12HourClock ? scheduleItem.SecondSet.HourStartString : TimespanHelper.ConvertTo12HourClock(scheduleItem.SecondSet.HourStartString); if (scheduleItem.SecondSet.HourEnd.TotalMinutes != 0) ((TextBox)e.Item.FindControl("tbHourEnd2")).Text = !Config.Use12HourClock ? scheduleItem.SecondSet.HourEndString : TimespanHelper.ConvertTo12HourClock(scheduleItem.SecondSet.HourEndString);
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
"00:00" time not displayed.
Hi all,
Not completely sure that this is a bug or is intended behaviour but I had a client who complained and so had to design a fix.
Basically if the first time in a set is "00:00" and the second time is any time after midnight then the first hour's box was blank.
I made a minor change to the OpeningHoursEditor.ascx.cs file that changed the way the times were displayed.
This means that as long as the second time is not "00:00" and the first time is "00:00", the first time will display instead of being a blank box:
This is purely a change in the way the times are displayed and does not affect anything else.
The code change is in the "oh_rptScheduleItems_ItemDataBound" method:
<code>
if (scheduleItem.FirstSet.HourEnd.TotalMinutes != 0)
{
((TextBox)e.Item.FindControl("tbHourStart")).Text = !Config.Use12HourClock ?
scheduleItem.FirstSet.HourStartString :
TimespanHelper.ConvertTo12HourClock(scheduleItem.FirstSet.HourStartString);
((TextBox)e.Item.FindControl("tbHourEnd")).Text = !Config.Use12HourClock ?
scheduleItem.FirstSet.HourEndString :
TimespanHelper.ConvertTo12HourClock(scheduleItem.FirstSet.HourEndString);
}
if (scheduleItem.SecondSet.HourEnd.TotalMinutes != 0)
{
((TextBox)e.Item.FindControl("tbHourStart2")).Text = !Config.Use12HourClock ?
scheduleItem.SecondSet.HourStartString :
TimespanHelper.ConvertTo12HourClock(scheduleItem.SecondSet.HourStartString);
((TextBox)e.Item.FindControl("tbHourEnd2")).Text = !Config.Use12HourClock ?
scheduleItem.SecondSet.HourEndString :
TimespanHelper.ConvertTo12HourClock(scheduleItem.SecondSet.HourEndString);
}
</code>
this replaces:
<code>
if (scheduleItem.FirstSet.HourStart.TotalMinutes != 0)
((TextBox)e.Item.FindControl("tbHourStart")).Text = !Config.Use12HourClock ?
scheduleItem.FirstSet.HourStartString :
TimespanHelper.ConvertTo12HourClock(scheduleItem.FirstSet.HourStartString);
if (scheduleItem.FirstSet.HourEnd.TotalMinutes != 0)
((TextBox)e.Item.FindControl("tbHourEnd")).Text = !Config.Use12HourClock ?
scheduleItem.FirstSet.HourEndString :
TimespanHelper.ConvertTo12HourClock(scheduleItem.FirstSet.HourEndString);
if (scheduleItem.SecondSet.HourStart.TotalMinutes != 0)
((TextBox)e.Item.FindControl("tbHourStart2")).Text = !Config.Use12HourClock ?
scheduleItem.SecondSet.HourStartString :
TimespanHelper.ConvertTo12HourClock(scheduleItem.SecondSet.HourStartString);
if (scheduleItem.SecondSet.HourEnd.TotalMinutes != 0)
((TextBox)e.Item.FindControl("tbHourEnd2")).Text = !Config.Use12HourClock ?
scheduleItem.SecondSet.HourEndString :
TimespanHelper.ConvertTo12HourClock(scheduleItem.SecondSet.HourEndString);
</code>
is working on a reply...