Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.

Datatables support timezone in M2 #25

Open
Forgev41 opened this issue Nov 27, 2015 · 2 comments
Open

Datatables support timezone in M2 #25

Forgev41 opened this issue Nov 27, 2015 · 2 comments

Comments

@Forgev41
Copy link

Timezone support for gvNIX Datatables (table)

When developing Spring Roo / gvNIX for enterprise web application to be hosted
in the cloud, timezone support is essential!

User will start questions when they see times they do not
recognize as theirs. See your demo Petclinic application at Redhat Openshift.
 

Using default Spring Roo or gvNIX with JQuery, this problem can be solved by the
developer by simple changing the tags in...webapp\WEB-INF\tags\form\fields
as described in StackOverflow: Spring Roo best practise showing dates in local
time

However, when using the gvNIX datatables, although one can add in the
...\webapp\WEB-INF\tags\datatables\column.tagx the tags, the handling is
done by Java outside JSPX.

 

<jsp:directive.attribute name="timeZone" type="java.lang.String" required="false" rtexprvalue="true" description="The timezone to use if the field is a date or calendar type" />

 

Request

Add timezone support to at least the Datatable listing in M2 release

Please add a timezone parameter to
...\webapp\WEB-INF\tags\datatables\column.tagx to <gvnixddt:column ...

 

  <!-- Roo parameters -->
  <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" />
  <jsp:directive.attribute name="property" type="java.lang.String" required="true" rtexprvalue="true" description="The property (field name) of the dataset to be displayed in a column (required)." />
  <jsp:directive.attribute name="maxLength" type="java.lang.Integer" required="false" rtexprvalue="true" description="Max displayed text length (default '10'). Unlimited if negative" />
  <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The column label to be used in the table (optional)." />
  <jsp:directive.attribute name="date" type="java.lang.Boolean" required="false" rtexprvalue="true" description="(Ignored just for Roo compatibility)" />
  <jsp:directive.attribute name="calendar" type="java.lang.Boolean" required="false" rtexprvalue="true" description="(Ignored just for Roo compatibility)" />
  <jsp:directive.attribute name="dateTimePattern" type="java.lang.String" required="false" rtexprvalue="true" description="The date / time pattern to use if the field is a date or calendar type" />

  <!-- Added -->
  <jsp:directive.attribute name="timeZone" type="java.lang.String" required="false" rtexprvalue="true" description="The timezone to use if the field is a date or calendar type" />


  <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" />
  <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" />

  <!-- Datatables parameters -->
  <jsp:directive.attribute name="uid" type="java.lang.String" required="false" rtexprvalue="true" description="Unique arbitrary id of the column, used in relation to the columnHead tag" />
  <jsp:directive.attribute name="title" type="java.lang.String" required="false" rtexprvalue="true" description="Name of the attribute of the current object being iterated object on, regardless the data source (DOM or AJAX) (precedence over label property)" />

  <!-- .... -->

  <gvnixddt:column
        id="${id}" 
        property="${property}" 
        maxLength="${empty maxLength ? 128 : maxLength}" 
        label="${label}"
        dateTimePattern="${dateTimePattern}"

                <!-- requested support to be added -->
        timeZone="${timeZone}"

        render="${empty render or render}"
        z="${z}"
        data-property="${property}" 

        uid="${uid}"
        title="${title}"

 

 

@Forgev41 Forgev41 changed the title Datatables support timezone Datatables support timezone in M2 Nov 27, 2015
@acesss
Copy link

acesss commented Dec 8, 2016

in my project i am try to add datatable but it not working

@eruiz
Copy link
Contributor

eruiz commented Dec 8, 2016

Spring Roo 2.0.0.M3 includes support for Thymeleaf 3 and Datatables.

Note the M3 version generate artifacts that could change in newer versions, so your project might not upgrade automatically if you open it with RC1 or above.

May the Force be with you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants