Logo of SermonSpeaker Extension Claim

Login Form

sermon_time

More
4 years 10 months ago - 4 years 10 months ago #3889 by marsu
sermon_time was created by marsu
Hi,

I adapt the tiles layout to my conception but i need some modification for the Date.

I want a layout for the date like this:


Therefore i need a single class for the day the month and the year!

any idea?
Attachments:
Last edit: 4 years 10 months ago by marsu.

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #3892 by Thomas Hunziker
Replied by Thomas Hunziker on topic sermon_time
I have an idea, yes. And it's easy :)
I'm not at my computer until tomorrow but you can have a look at the JHtml:Date() function. You need that twice, once for the month and once for the day. The function takes a format string where you can only return the day or month part if you like. Usually SermonSpeaker takes this string from the language files using JText but you can also use you own format.

Feel free to rate SermonSpeaker on JED .
Useful documentation for beginners: First Steps & FAQ
How to say "Thank You!": Contribute or support using the Donate button at the bottom of each page.

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #3894 by Thomas Hunziker
Replied by Thomas Hunziker on topic sermon_time
Something like that should do what you want:
<span class="month"><?php echo JHtml::Date($item->sermon_date, 'M', true); ?></span>
<span class="day"><?php echo JHtml::Date($item->sermon_date, 'j', true); ?></span>

For the format string you can have a look at php.net/manual/function.date.php

Feel free to rate SermonSpeaker on JED .
Useful documentation for beginners: First Steps & FAQ
How to say "Thank You!": Contribute or support using the Donate button at the bottom of each page.

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago - 4 years 10 months ago #3899 by marsu
Replied by marsu on topic sermon_time
thx!
if somebody needs it:
<date style="border-right: 1px solid;
    color: #303030;
    float: left;
    font-family: Arial,Helvetica,sans-serif;
    margin-right: 15px;
    padding: 2px 5px;
    text-align: center;
    width: 30px;"> 
<span style="display: block;
    font-size: 8px;
    line-height: 8px;
    margin-bottom: 1px;
    text-transform: uppercase;"><?php echo JHtml::Date($item->sermon_date, 'M', true); ?></span>
<span style=" display: block;
    font-size: 12px;
    font-weight: bold;
    line-height: 12px;"><?php echo JHtml::Date($item->sermon_date, 'j', true); ?></span>
Last edit: 4 years 10 months ago by marsu.

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #3900 by Thomas Hunziker
Replied by Thomas Hunziker on topic sermon_time
Do you have a page where I can see how it looks? Sounds like an interesting thing to improve the tiles layouts :)

Feel free to rate SermonSpeaker on JED .
Useful documentation for beginners: First Steps & FAQ
How to say "Thank You!": Contribute or support using the Donate button at the bottom of each page.

Please Log in or Create an account to join the conversation.

Time to create page: 0.170 seconds
Powered by Kunena Forum