Welcome, Guest
Username: Password: Remember me

TOPIC: Error dates

Error dates 6 years 2 months ago #2875

  • datrigo
  • datrigo's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 11
  • Karma: 0
hi,

Today, November 1, we have activated our first website and have a problem with the component. When setting the dates of the deals we put a date and if we accept the dates are changed. You'll see in this image:



It is urgent for us to resolve this topic.

Thank you
The administrator has disabled public write access.

Error dates 6 years 2 months ago #2876

  • hungtran
  • hungtran's Avatar
  • Offline
  • Moderator
  • Posts: 1636
  • Thank you received: 245
  • Karma: 27
Hi,

This problem didn't happen before, it seems Joomla tries to convert the dates to the user's timezones before saving them.

To fix this you can modify components/com_cmgroupbuying/models/forms/deal.xml, replace
		<field
			name="start_date"
			type="calendar"
			label="COM_CMGROUPBUYING_DEAL_FIELD_START_DATE_LABEL"
			description="COM_CMGROUPBUYING_DEAL_FIELD_START_DATE_DESC"
			class="inputbox"
			size="22"
			format="%Y-%m-%d %H:%M:%S"
			required="true"
		/>

		<field
			name="end_date"
			type="calendar"
			label="COM_CMGROUPBUYING_DEAL_FIELD_END_DATE_LABEL"
			description="COM_CMGROUPBUYING_DEAL_FIELD_END_DATE_DESC"
			class="inputbox"
			size="22"
			format="%Y-%m-%d %H:%M:%S"
			required="true"
		/>

with
		<field
			name="start_date"
			type="calendar"
			label="COM_CMGROUPBUYING_DEAL_FIELD_START_DATE_LABEL"
			description="COM_CMGROUPBUYING_DEAL_FIELD_START_DATE_DESC"
			class="inputbox"
			size="22"
			format="%Y-%m-%d %H:%M:%S"
			required="true"
			filter="server_utc" />
		/>

		<field
			name="end_date"
			type="calendar"
			label="COM_CMGROUPBUYING_DEAL_FIELD_END_DATE_LABEL"
			description="COM_CMGROUPBUYING_DEAL_FIELD_END_DATE_DESC"
			class="inputbox"
			size="22"
			format="%Y-%m-%d %H:%M:%S"
			required="true"
			filter="server_utc" />
		/>

And make sure you have already selected your time zone in Global Configuration.

Regards,
Hung
Last Edit: 6 years 2 months ago by haunguyen.
The administrator has disabled public write access.

Error dates 6 years 2 months ago #2877

  • datrigo
  • datrigo's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 11
  • Karma: 0
Sorry to tell you that this has not worked. The problem persists. :(

The time zone that I have selected is the same for ALL web, Madrid.

What else can I do?
The administrator has disabled public write access.

Error dates 6 years 2 months ago #2878

  • hungtran
  • hungtran's Avatar
  • Offline
  • Moderator
  • Posts: 1636
  • Thank you received: 245
  • Karma: 27
Hi,

It does work for me here, I use CMGroupBuying 2.8.0 and Joomla 3.3.6.

And actually, this problem doesn't happen if the current admin user's timezone and Joomla's timezone are the same, because by default Joomla will convert the dates which are selected on the calendars to the user's timezone, this is why we add filter="server_utc" to ask Joomla to use server's timezone instead of admin user's timezone.

If this problem still happens please submit a support ticket with your admin access and FTP access, I will debug to see why this only happens to your site.

Thank you and regards,
Hung
The administrator has disabled public write access.
The following user(s) said Thank You: datrigo