Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Date Format y/m/d but is set to d/m/y in Joomla25?
(1 viewing) (1) Guest
Universal booking and reservations component for Joomla!.

NOTE: This category has been locked. If you have purchased paid version, please, use our Support Ticket system instead. If you are using free edition, please see the Community Support section.
  • Page:
  • 1

TOPIC: Date Format y/m/d but is set to d/m/y in Joomla25?

Date Format y/m/d but is set to d/m/y in Joomla25? 12 years, 8 months ago #29686

Hi,

My Date format when a booking is reserved is showing as yyyy/mm/dd. I would like this to reflect the default Joomla 2.5 setting of dd/mm/yyyy but when I look into the language/en-GB/en-GB.com_booking.ini file the date formats do not match up to Joomla's default settings:

Joomla default en-GB.ini code:

DATE_FORMAT_LC="l, d F Y"
DATE_FORMAT_LC1="l, d F Y"
DATE_FORMAT_LC2="l, d F Y H:i"
DATE_FORMAT_LC3="d F Y"
DATE_FORMAT_LC4="d-m-Y"
DATE_FORMAT_JS1="d-m-y"

Artio Bookit en-GB.com_booking.ini code:
; Date formats
DATE_FORMAT_LC2="%d %B %Y %H:%M"
DATE_FORMAT_LC3="%d %B %Y"
DATE_FORMAT_LC5="%a %d %b %Y"
DATE_FORMAT_LC6="%d %b"

I would really appreciate if someone could look into this issue please.

Regards Rachael
The topic has been locked.

Re: Date Format y/m/d but is set to d/m/y in Joomla25? 12 years, 7 months ago #29810

  • jitr
  • OFFLINE
  • ARTIO Support
  • Posts: 1432
Hello, Booking overwrites default Joomla settings for date formats. It's no problem.
You can change Booking language files or set custom formats in Booking configuration.

config_2012-05-02.png
ARTIO Support Team
The topic has been locked.

Re: Date Format y/m/d but is set to d/m/y in Joomla25? 12 years, 7 months ago #29875

Thank you for your reply. It worked great in the calendar section.

I have since discovered also that the date format on the reservation page is quite confusing. Please view my attachment

date-format.jpg


You will see that the reservation stored reads:

From - to: 08:00 15May12 - 09:00 15May12

I would like to only show the date once if possible - e.g:

From - to: 15May12 08:00 - 09:00

Can you please advise in the code how I can fix this?
The topic has been locked.

Re: Date Format y/m/d but is set to d/m/y in Joomla25? 12 years, 7 months ago #29902

  • jitr
  • OFFLINE
  • ARTIO Support
  • Posts: 1432
Hello, I thought that it already works in this way ...

Open administrator/com_booking/helpers/html.php

There is function looks like:

 
/**
* Display reservation interval.
*
* @param TableReservation $reservation
*/

function interval(&$reservation, $offset = null)
{
if (AHtml::date($reservation->from, ADATE_FORMAT_MYSQL_TIME, $offset) == '00:00:00' && AHtml::date($t = $reservation->to, ADATE_FORMAT_MYSQL_TIME, $offset) == '23:59:00') {
// full day reservation
if (AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset) == AHtml::date($reservation->to, ADATE_FORMAT_NORMAL, $offset))
// reservation begins and ends in the same day
return JText::sprintf('Interval date', AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset));
else
return JText::sprintf('Interval from to', AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset), AHtml::date($reservation->to, ADATE_FORMAT_NORMAL, $offset));
} else
// partly day reservation (hourly or night booking)
return JText::sprintf('Interval from to time up down', AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset), AHtml::date($reservation->from, ATIME_FORMAT_SHORT, $offset), AHtml::date($reservation->to, ADATE_FORMAT_NORMAL, $offset), AHtml::date($reservation->to, ATIME_FORMAT_SHORT, $offset));
}
 


Replace it with this code:

 
/**
* Display reservation interval.
*
* @param TableReservation $reservation
*/

function interval(&$reservation, $offset = null)
{
if (AHtml::date($reservation->from, ADATE_FORMAT_MYSQL_TIME, $offset) == '00:00:00' && AHtml::date($t = $reservation->to, ADATE_FORMAT_MYSQL_TIME, $offset) == '23:59:00') {
// full day reservation
if (AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset) == AHtml::date($reservation->to, ADATE_FORMAT_NORMAL, $offset))
// reservation begins and ends in the same day
return JText::sprintf('Interval date', AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset));
else
return JText::sprintf('Interval from to', AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset), AHtml::date($reservation->to, ADATE_FORMAT_NORMAL, $offset));
} else
// partly day reservation (hourly or night booking)
if (AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset) == AHtml::date($reservation->to, ADATE_FORMAT_NORMAL, $offset))
// day begin and day end are the same
return JText::sprintf('Interval day time up down', AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset), AHtml::date($reservation->from, ATIME_FORMAT_SHORT, $offset), AHtml::date($reservation->to, ATIME_FORMAT_SHORT, $offset));
// day begin and day end are different
return JText::sprintf('Interval from to time up down', AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset), AHtml::date($reservation->from, ATIME_FORMAT_SHORT, $offset), AHtml::date($reservation->to, ADATE_FORMAT_NORMAL, $offset), AHtml::date($reservation->to, ATIME_FORMAT_SHORT, $offset));
}
 


Then add into administrator/language/en-GB/en-GB.com_booking.common.ini

INTERVAL DAY TIME UP DOWN="%s %s - %s"
ARTIO Support Team
The topic has been locked.

Re: Date Format y/m/d but is set to d/m/y in Joomla25? 12 years, 7 months ago #29954

HI,

Thank you for this fix - it has solved my issue but I just thought for anyone else using Joomla 2.5 the file path you provided is different:

jitr wrote:
Hello, I thought that it already works in this way ...

Open administrator/com_booking/helpers/html.php


[/quote]

It is actually:
administrator/components/com_booking/helpers/html.php

Regards, Rachael
The topic has been locked.
  • Page:
  • 1
User Login Empty