Main menu

Forum


× Help Forum English

[SOLVED] Compatibility with Frontpage Slideshow & other questions

  • jonmar
  • Autore della discussione
  • Junior Member
  • Junior Member
Di più
7 Anni 6 Mesi fa #13394 da jonmar
Sorry, I had forgotten about your question.

We use 3 languages for the front end, Norwegian (default), Finnish and English. For all languages, we need the date to appear as D.M.-D.M. So, without leading zeros for day or month, and without spaces before and after the date separator, and a period after the month. I looked in the options for the date formatting but an option without leading zeros doesn't exist. It mentions a "customisable international date format" but I didn't see any way to customise it.

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • Lyr!C
  • Avatar di Lyr!C
  • Administrator
  • Administrator
  • Lead Developer
Di più
7 Anni 6 Mesi fa - 7 Anni 6 Mesi fa #13430 da Lyr!C

jonmar ha scritto: Sorry, I had forgotten about your question.

We use 3 languages for the front end, Norwegian (default), Finnish and English. For all languages, we need the date to appear as D.M.-D.M. So, without leading zeros for day or month, and without spaces before and after the date separator, and a period after the month. I looked in the options for the date formatting but an option without leading zeros doesn't exist. It mentions a "customisable international date format" but I didn't see any way to customise it.

Hi!

I will check later for adding an option to show/hide leading zero (as currently, i'm using only the standard internationnal ISO date format as set for each country/cultures (some have leading zero as standard, and some not...))
But i agree that an option could be added for people where the language has leading zero in standard ISO, but want to get this one removed ;-)

So will see maybe for 3.6.5 to add such an option.

About a custom display of dates, exactly as you want, and as you have done a custom theme pack, do you have read this message : www.joomlic.com/fr/forum/icagenda-help-e...s?limitstart=0#13217 ?

Because there, i mention that $EVENT_DATE is a preformatted HTML data, so not to be modified.

BUT, you can use $item->startdate, $item->enddate (start and end dates of a period in database) or the variable $evt which is the date in ISO format used in the "date box".

So, could you read again all my messages to make sure you have understood all the information i've given, and if not to tell me what you don't understand, and what addtionnal information you need to set your custom php code to format dates ? (as not all my questions answered, so i can't give you the best help as possible....)

Thank you!
Regards,
Cyril

Question: you may have already no leading zero in Finnish (as no leading zero in Finnish ISO standards) ;-)

Latest version : iCagenda 3.9.3
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File allegato:

Ultima Modifica 7 Anni 6 Mesi fa da Lyr!C.

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • jonmar
  • Autore della discussione
  • Junior Member
  • Junior Member
Di più
7 Anni 6 Mesi fa #13432 da jonmar
Hi,

The option to hide the leading zero would be awesome. I'm currently using the 30_04 option from the DMY section as this is the closest I can get to how I need the date to be displayed.

I did try $item->startdate, $item->enddate as well as $evt, but I don't know how to hide the time of day from those.

In your post you said:

"In all cases, you can always set your own PHP code to format date as espected.
For this, use the PHP variable $evt to get the event date in database iso datetime format : YYYY-MM-DD HH:MM:SS (easy then to manipulate it with a php date fonction)."

Trouble is I don't know how to use PHP to format the date, or how to use the PHP date function. I need instruction with that. Basically I just need the format to be like this: DD.MM. so no leading zeros, no year, no time of day, and the date should end with a period.

By the way I checked the Finnish version of my site and the dates still had leading zeros. In the back end options it says that the date format function looks at the language of the Joomla admin. My admin is in English, but my front end is in Norwegian (default), Finnish and English. Could this be causing an issue? Maybe iCagenda is showing the English ISO standard for all languages in the front end because my admin is in English only?

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • Lyr!C
  • Avatar di Lyr!C
  • Administrator
  • Administrator
  • Lead Developer
Di più
7 Anni 6 Mesi fa - 7 Anni 6 Mesi fa #13462 da Lyr!C
Hello,

Sorry for slow response, i was a bit busy...

I thought you knew about php date ;-)

So, the date you get using $item-startdate, $item->enddate or $evt is a datetime php date YYYY-MM-DD HH:MM:SS

You can then format it using date php function.

But the best is using Joomla API to be sure the date is well translated in your language.

Here the list of php date format characters you can use : php.net/manual/en/function.date.php

Example :
JHtml::_date('j F Y G:i', $item->stardate, null);

Hope this helps ?

Regards,
Cyril

Latest version : iCagenda 3.9.3
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File allegato:

Ultima Modifica 7 Anni 6 Mesi fa da Lyr!C.

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • jonmar
  • Autore della discussione
  • Junior Member
  • Junior Member
Di più
7 Anni 6 Mesi fa - 7 Anni 6 Mesi fa #13475 da jonmar
So where do I put the example code you gave? Sorry if it's a dumb question, but like I said I don't know anything about PHP.

Also, when I use $item->startdate, $item->enddate the events that only have a single date just display 000-00-00 00:00 because they don't have a start date and end date set. They just have a single date.

When I use $evt, the long running events only display the start date, but not the end date.

The only way I can get both types of events to display correctly is by using $EVENT_DATE.
Ultima Modifica 7 Anni 6 Mesi fa da jonmar.

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • Lyr!C
  • Avatar di Lyr!C
  • Administrator
  • Administrator
  • Lead Developer
Di più
7 Anni 6 Mesi fa - 7 Anni 6 Mesi fa #13480 da Lyr!C

So where do I put the example code you gave? Sorry if it's a dumb question, but like I said I don't know anything about PHP.

I thought you had a minimum knowledge as you have created your own theme pack (using php/html structure... :whistle: )

$evt is the date use for generating the list. It is the reference date (used in the day month year display in the datebox in list of events view).
If you want to get the date of a single date (in multiple single dates), you use only $evt variable.
<?php echo JHtml::date($evt, 'j.n', null); ?>

If you want to get the period (from too), $evt will be the start date or current date if event in process, so, in this case, and only if you use period, you use something like this :
<?php echo JHtml::date($item->stardate, 'j.n', null); ?> - <?php echo JHtml::date($item->enddate, 'j.n', null); ?>

I can't tell you which one of the code above to use and where exactly, as you don't have answered all my previous questions... :pinch:

So.... :whistle:

Latest version : iCagenda 3.9.3
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File allegato:

Ultima Modifica 7 Anni 6 Mesi fa da Lyr!C. Motivo: Error in JHtml::date function

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • jonmar
  • Autore della discussione
  • Junior Member
  • Junior Member
Di più
7 Anni 6 Mesi fa #13486 da jonmar
Actually I tried to use the code like that before, but it causes the website to load blank with only this text showing up at the top:


juni

I just put the code inside the div with the class ic-day. Where the original $EVENT_DATE is (I commented it out).

I thought I had answered all of your questions so far. Can you tell me which ones I haven't answered yet, and I will do so ASAP.

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • Lyr!C
  • Avatar di Lyr!C
  • Administrator
  • Administrator
  • Lead Developer
Di più
7 Anni 6 Mesi fa - 7 Anni 6 Mesi fa #13499 da Lyr!C
Hi!

Well, maybe copy/paste your full code of your entire file here, and i will check this ;-)
(or attached in zip your theme pack).

But, i will plan to add the "leading zero on/off" option in a future version of iCagenda (don't know yet which one, but maybe one of the 3.6.x serie, as i have some updates for date formats and a few languages to do, so will check this possibility in the same time ;-) )

Best Regards,
Cyril

I thought I had answered all of your questions so far. Can you tell me which ones I haven't answered yet, and I will do so ASAP.

Well, it was about your usage (only single dates ? only period ? or mix of two) but don't worry now, it was to give you a quick answer, but in the case i stated you had enough php knowledge, which is not the case, so i will see your custom code, it would be faster ;-) )

Latest version : iCagenda 3.9.3
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File allegato:

Ultima Modifica 7 Anni 6 Mesi fa da Lyr!C.

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • jonmar
  • Autore della discussione
  • Junior Member
  • Junior Member
Di più
7 Anni 6 Mesi fa - 7 Anni 6 Mesi fa #13515 da jonmar
Hi,

Here is the theme pack in zip format:

We use a mix of event types. The site is for a cultural institute that helps to arrange events. Some events, like concerts etc. are single dates, and others, like exhibitions, are period events.

Yeah I don't know much about PHP. Almost nothing at all. I never tried to learn it (seriously thinking about it now!). I can look at the code and figure out some simple things that I can edit (like the echo statement), but I can't write anything from scratch. To create my custom theme, all I had to do was edit the HTML and CSS files, and then I commented out some parts that I needed to hide.
Ultima Modifica 7 Anni 6 Mesi fa da jonmar.

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • Lyr!C
  • Avatar di Lyr!C
  • Administrator
  • Administrator
  • Lead Developer
Di più
7 Anni 6 Mesi fa - 7 Anni 6 Mesi fa #13526 da Lyr!C
Hello,

So in fact i did errors in my previous php code (i have updated the message to not keep those errors).

In your file finno_events.php, line 48, do this :
	<?php // Day ?>
	<div class="ic-day">
		<?php if (iCDate::isDate($item->startdate) && ! $item->weekdays) : ?>
			<?php echo JHtml::date($item->startdate, 'j.n', null); ?> - <?php echo JHtml::date($item->enddate, 'j.n', null); ?>
		<?php else : ?>
			<?php echo JHtml::date($evt, 'j.n', null); ?>
		<?php endif; ?>
	</div>

if a full period (from... to... with no weekdays selected) it will display 27.10 - 1.12 (example from 27 October to 1 December)
If period divided into single days or if usage of single dates, it will display this: 1.12 (example for 1 December).

I think it is almost what you want to do ?

Best Regards,
Cyril

Latest version : iCagenda 3.9.3
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File allegato:

Ultima Modifica 7 Anni 6 Mesi fa da Lyr!C.

Si prega Accedi o Crea un account a partecipare alla conversazione.

Moderatori: Lyr!C
Tempo creazione pagina: 0.282 secondi

Follow Us

Create your Joomla templates with Template Creator CK

acymailing logo new