Elxis CMS Forum

Support => General => Topic started by: pavel on January 09, 2009, 19:13:23

Title: Formatting date in Elxis content items
Post by: pavel on January 09, 2009, 19:13:23
Is there any way to control the date format in content items and eblog?   

Currently my Eblog ouputs the date as following:
<div class="eblog-postdate">Thursday, 08 January 2009 01:09</div>

I would like to:

1) Display a date in a different format, for example 09-01-2009 or 09 JAN 2009?

or, better, to:

2) Wrap each individual .eblog-postdate item in individual tags.  For example, here is how it is done in Wordpress:

<div class="date_label">
  <div class="date_day">2</div>
  <div class="date_month">Jan</div>
  <div class="date_year">2009</div>
  <div class="comments_count">50</div>
</div>

This allows to customize design of each date/time element with CSS producing a unique look of the site.   Is it possible to do do the same in Elxis?
Title: Re: Formatting date in Elxis content items
Post by: datahell on January 09, 2009, 19:26:19
The date format in Elxis is controlled by the "gemini" language files. For instance for the English language you should edit file:
language/english/english.gemini.php

Short date format:
DEFINE('_GEM_DATE_FORMLC', "%A, %d %B %Y");

Extended date format:
DEFINE('_GEM_DATE_FORMLC2', "%A, %d %B %Y %H:%M");

Third party component may use hard-coded style. Eblog also uses a special hard-coded style.
Title: Re: Formatting date in Elxis content items
Post by: pavel on January 11, 2009, 00:15:58
Thank you for your reply.   I decided to leave the date format as is to avoid any problems with functionality and to focus on CSS STYLING of the date/time block.  I also looked at several other blogs and many are using the same long format with a unique styling.

 

Title: Re: Formatting date in Elxis content items
Post by: Farhad Sakhaei on January 17, 2009, 21:44:30
John , I have a problem with converting eblog archive dates to persian dates ,
How can I do this ?
Because for converting to persian date , I should have complete date , The date will calculate by the given day of the month , month of the year...
I reviewed the code , But got that there is a system for dates , That it shows the month and year separately ...   :-[
Title: Re: Formatting date in Elxis content items
Post by: datahell on January 17, 2009, 22:16:52
I think you have to completely modify eblog and it's SEO PRO extension to be able to have a complete Persian calendar because you dont have just different names in months, you have different number of days for each month, different year, different start/end month days, etc. I don't know if this is too serious to make such modifications. I advise you to leave it as is....

eblog archive show each month's posts. Let's say we want to display the archive for January 2009. in this case we will search our database for posts between 2009-01-01 00:00:00 and 2009-01-31 23:59:59 (database table: #__eblog, column: dateadded).

In the Persian version let's say you have to display archived posts for Persian month X, year Z. Make the new start and end dates by converting Persian dates to Gregorian dates:
Persian start date: Z-X-1 00:00:00 ---> convert to Gregorian start date (Date1)
Persian end date: Z-X-W 23:59:59 ---> convert to Gregorian end date (Date2)
Were W the number of days of month X.

Now search for posts between Date1 and Date2

SEO PRO extension might also need modification, modules needs modification, etc, etc,...
Title: Re: Formatting date in Elxis content items
Post by: Farhad Sakhaei on January 17, 2009, 22:36:39
Oooopps ,
I should say that I was converted whole dates in the Elxis core and also all components , modules , This was the only problem with converting dates to Persian dates ...
I leave it alone :D