Login or create new account.

By registering on joomprod.com, you will have immediate access to all our free products and to the public side of our support forum.

Enjoy our subscriptions.

Each of our subscriptions allow you to enjoy the private side of the support forum and all the update of our products for a period ranging from 3 months to 1 year.

Payment And immediate download.

After subscribing to one of our subscription, the products are immediately downloadable.

Login

Or Register
Accueil / forum / Public Forum / Main Forum / [RESOLVED] Change Date to Persian (Jalali) Date

Support Availability Because we must sleep sometimes

Working days: Monday to Friday.
Reply time: Depending on the complexity of your support issue it's usually between a few hours to 48 hours.

Support is only guaranteed to paid subscribers

AdsManager - End of life

It is with great regrets that we have chosen to end the developpement of Adsmanager and its other associated components.

AdsManager is born 10 years ago and, as of today, the number of new subscriptions and downloads have fallen and we cannot maintain the component anymore.

All active subscribers will be able to continue enjoying support until the end of their subscription.

The components will be free and no support will be provided anymore for the other users.

×

Notice

The forum is in read only mode.

× OLD Forum post could be checked here : forum.joomprod.com

[RESOLVED] Change Date to Persian (Jalali) Date

  • mojtabapordel
  • Topic Author
  • Offline
  • User
  • User
More
8 years 6 months ago - 8 years 5 months ago #22280 by mojtabapordel
Hi
Thank you for your great component.
My Joomla version is 3.6.2 and AdsManager version is 3.1.6
My site language is Persian and the date in all of my site is in Persian format (Jalali Date), But in AdsManager the date format is Gregorian.
I know the date function in AdsManager is:
function reorderDate( $date ){
		$format = JText::_('ADSMANAGER_DATE_FORMAT_LC');
 
		if ($date && (preg_match("/([0-9]{4})-([0-9]{2})-([0-9]{2})/",$date,$regs))) {
			$date = mktime( 0, 0, 0, $regs[2], $regs[3], $regs[1] );
			$date = $date > -1 ? strftime( $format, $date) : '-';
		}
		return $date;
	}

How can I change it to Joomla default date format? Actually I want that AdsManager call the Joomla Persian date not it's default Gregorian date.
Thank you for your help.

AdsManager Date:



Joomla Date:

Attachments:
Last edit: 8 years 5 months ago by loic.
More
8 years 6 months ago #22298 by loic
Hello,

The format is defined by the translation string ADSMANAGER_DATE_FORMAT_LC
You can change the format by overriding this string in Extensions -> Language -> Override.

Best regards.
The following user(s) said Thank You: mojtabapordel
  • mojtabapordel
  • Topic Author
  • Offline
  • User
  • User
More
8 years 6 months ago #22316 by mojtabapordel
Replied by mojtabapordel on topic Change AdsManager Date to Persian (Jalali) Date

loic wrote: Hello,

The format is defined by the translation string ADSMANAGER_DATE_FORMAT_LC
You can change the format by overriding this string in Extensions -> Language -> Override.

Best regards.

Thank you, But How?!!!
What string I should use to show the date in Persian format?
More
8 years 6 months ago #22326 by loic
Hello,

You can change the format by using those keys, just add them in the value field of the language override :
%m for the month
%d for the day
%Y for the year

I have found that the Persian date format is a special format, I don't know if that will help you.

Best regards.
The following user(s) said Thank You: mojtabapordel
  • mojtabapordel
  • Topic Author
  • Offline
  • User
  • User
More
8 years 6 months ago #22329 by mojtabapordel
Replied by mojtabapordel on topic Change AdsManager Date to Persian (Jalali) Date
OK, Thank you again
Let me explain something. If I change the date function like this:
function reorderDate( $date ){
       $format = JText::_('ADSMANAGER_DATE_FORMAT_LC');
 
       if ($date && (preg_match("/([0-9]{4})-([0-9]{2})-([0-9]{2})/",$date,$regs))) {
           $date = mktime( 0, 0, 0, $regs[2], $regs[3], $regs[1] );
           $date = $date > -1 ? strftime( $format, $date) : '-';
       }
       return $date;
   }

Change to:
function reorderDate( $date ){
$format = JText::_('ADSMANAGER_DATE_FORMAT_LC');
$date = JHTML::_('date', $date->created, JText::_('DATE_FORMAT_LC'));
return $date;
}

The date format will be shown in Persian style, But the problem is that the date converts to "Today Date", not "Ad's Created Date".
How can I solve this problem?
More
8 years 6 months ago #22335 by loic
Hello,

I will test your code and fix it.
I come back to you today or tomorrow.

Best regards.
The following user(s) said Thank You: mojtabapordel
Moderators: perry
Time to create page: 0.162 seconds
Powered by Kunena Forum