[opencms-dev] ContentShow: DateTime

Stefan Uldum Grinsted sug at interactive.as
Fri Jul 29 09:50:05 CEST 2005


Hello Sebastian

I'm not familiar with the taglib you speak of either, but I use the JSTL 
format taglib:

<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>

<c:set var="dateString">
        <cms:contentshow element="Date" />
</c:set>
<%
        java.util.Date date = new java.util.Date();
 
date.setTime(Long.parseLong(pageContext.getAttribute("dateString").toString()));
        pageContext.setAttribute("date", date);
%>
<fmt:formatDate value="${date}" type="date" dateStyle="long"  />


In this way the date get formated in the locale of the site-context, e.g. 
I use danish locale, and the date get formated like i should.

You can see documentation for the taglib here:

http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html


Best Regards
Stefan Uldum Grinsted
---------------------------------
Par No 1 Interactive a|s
sug at interactive.as




"Sebastian Lavena" <slavena at mkti.com.ar> 
Sent by: opencms-dev-bounces at opencms.org
28-07-2005 14:00
Please respond to
The OpenCms mailing list <opencms-dev at opencms.org>


To
"The OpenCms mailing list" <opencms-dev at opencms.org>
cc

Subject
Re: [opencms-dev] ContentShow: DateTime






I couldn´t find the taglib "i18n-1.0", but with your code you give me 
ideas, 
and I parse in "my way" the date, to write it in my html in spanish 
format, 
and 2 digit for day and month (i.e.: 30/05/05 and not 30/5/05).

So, thanks, my problem is now solved. But I think that´s probably the 
library "i18n-1.0", can be helpful to me in the future... any idea that´s 
where I can find it..?

Best regards,

Sebastian


----- Original Message ----- 
From: "Borja Marcos Suarez" <borja.suarez at fundacionctic.org>
To: "The OpenCms mailing list" <opencms-dev at opencms.org>
Sent: Thursday, July 28, 2005 3:06 AM
Subject: RE: [opencms-dev] ContentShow: DateTime


I think that the standard way to do it is using the standard i18n as 
follows:

<%@ taglib uri="http://jakarta.apache.org/taglibs/i18n-1.0" prefix="i18n" 
%>
<cms:contentcheck ifexists="YourDateElement">
<c:set var="yourDate"><cms:contentshow element="YourDateElement" 
/></c:set>
<%
Date date= null;
try
{
date = new 
Date(Long.parseLong((String)pageContext.getAttribute("yourDate")));
}
catch (Exception e)
{
out.println (e.getMessage());
}
%>
<i18n:formatDate value='<%= date %>' style="short" />
</cms:contentcheck>

Hope this helps you,

Best regards

Borja Marcos Suarez


-----Mensaje original-----
De: opencms-dev-bounces at opencms.org 
[mailto:opencms-dev-bounces at opencms.org] 
En nombre de Sebastian Lavena
Enviado el: miércoles, 27 de julio de 2005 22:58
Para: The OpenCms mailing list
Asunto: [opencms-dev] ContentShow: DateTime

Hi list!

I'm trying to show a date (not time), in my web...
I have in an XML a DateTimeOpenCms, but if I use "<cms:contentshow
element="DateTime" />", OpenCMS writes in my html a large number (the
longint that´s represent the dateTime).

So, hoy I can write in my html (from jsp) only the date that´s this number
represent?

Thanks you very much,

Sebastián



_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev


_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev


__________ NOD32 1.1179 (20050727) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com




_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050729/5f29c8c7/attachment.htm>


More information about the opencms-dev mailing list