You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Davor Hrg (JIRA)" <de...@tapestry.apache.org> on 2008/02/25 22:54:51 UTC
[jira] Created: (TAPESTRY-2198) Date formating global support
Date formating global support
-----------------------------
Key: TAPESTRY-2198
URL: https://issues.apache.org/jira/browse/TAPESTRY-2198
Project: Tapestry
Issue Type: Improvement
Affects Versions: 5.0.11
Reporter: Davor Hrg
there is a javascript implementation of
SimpleDateFormat and is apache 2.0 licensed
http://www.timdown.co.uk/code/simpledateformat.php
it implements most of:
http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
It is 8.7 Kb with stripped comments.
I'm looking at making a trimmed down version that can parse/format only numeric date parts : day, month, year, dour, min sec.
This covers most likely usages on the client side (forms and datefield) and would make shorter code.
(I feel that prototype is bloated already so another 10K does not look apealing)
Not to complicate things and optimize too soon, full lib can be used now,
and later along with "multiple js lib support" the short version should be made available and pushed as default.
while talking about dates... date format should be in message catalog so it is locale specific.
for example in my language date format is: dd.MM.yyyy
there should be different keys for server side format and client side format
(the formats should be compatible of course)
tapestry-date-format-server=MM/dd/yyyy
tapestry-date-format-js=MM/dd/yyyy
(which are sam in case we use forementioned lib)
or, if one would choose to use the former date picker i would be:
tapestry-date-format-server=MM/dd/yyyy
tapestry-date-format-js=%m.%d.%Y
I feel strongly about this being global key instead parameter for
datefield, but even if it is only for date-field there should be two formats (server and js)
in the end... the formater should be used to test validity for the field on the client side
or regexp added to message catalog
tapestry-date-format-js-regex=...complex or simple regex......
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-2198) Date formating global support
Posted by "Davor Hrg (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625226#action_12625226 ]
Davor Hrg commented on TAPESTRY-2198:
-------------------------------------
here's a crazy thought:
server side could be used to do the conversions using ajax,
and by this inline perfectly with the SimpleDateFormat because
SimpleDateFormat would be actualy doing the hard work,
as tapestry will most likely have an js library abstraction
this can also be made replaceable by defining for example
Tapestry.formatDate(dateObj, formatStr) :: String
Tapestry.parseDate(dateStr, formatStr) :: Date
finally, an limited implementation of SimpleDateFormat
shouldn't be too hard
y - Year. 1x,2x,3x - year truncated to 2 digits, 4x+ - year padded with zeroes if needed
M - Month
d - day of month
H - Hour (0-23)
k - Hour (1-24)
m - minute
s - seconds
a - AM,PM marker
numbers :
formatting: 1x - number, 2x+ - padded
parsing: number of digits is ignored unless there is no separator with adjactent fields
I'm saying all this because I see my self using the js conversion only for the DateField
component... and all the rest would be from server side...
> Date formating global support
> -----------------------------
>
> Key: TAPESTRY-2198
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2198
> Project: Tapestry
> Issue Type: Improvement
> Affects Versions: 5.0.11
> Reporter: Davor Hrg
> Assignee: Howard M. Lewis Ship
>
> there is a javascript implementation of
> SimpleDateFormat and is apache 2.0 licensed
> http://www.timdown.co.uk/code/simpledateformat.php
> it implements most of:
> http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
> It is 8.7 Kb with stripped comments.
> I'm looking at making a trimmed down version that can parse/format only numeric date parts : day, month, year, dour, min sec.
> This covers most likely usages on the client side (forms and datefield) and would make shorter code.
> (I feel that prototype is bloated already so another 10K does not look apealing)
> Not to complicate things and optimize too soon, full lib can be used now,
> and later along with "multiple js lib support" the short version should be made available and pushed as default.
> while talking about dates... date format should be in message catalog so it is locale specific.
> for example in my language date format is: dd.MM.yyyy
> there should be different keys for server side format and client side format
> (the formats should be compatible of course)
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=MM/dd/yyyy
> (which are sam in case we use forementioned lib)
> or, if one would choose to use the former date picker i would be:
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=%m.%d.%Y
> I feel strongly about this being global key instead parameter for
> datefield, but even if it is only for date-field there should be two formats (server and js)
> in the end... the formater should be used to test validity for the field on the client side
> or regexp added to message catalog
> tapestry-date-format-js-regex=...complex or simple regex......
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Closed: (TAPESTRY-2198) Date formating global support
Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship closed TAPESTRY-2198.
------------------------------------------
Resolution: Duplicate
Assignee: Howard M. Lewis Ship
> Date formating global support
> -----------------------------
>
> Key: TAPESTRY-2198
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2198
> Project: Tapestry
> Issue Type: Improvement
> Affects Versions: 5.0.11
> Reporter: Davor Hrg
> Assignee: Howard M. Lewis Ship
>
> there is a javascript implementation of
> SimpleDateFormat and is apache 2.0 licensed
> http://www.timdown.co.uk/code/simpledateformat.php
> it implements most of:
> http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
> It is 8.7 Kb with stripped comments.
> I'm looking at making a trimmed down version that can parse/format only numeric date parts : day, month, year, dour, min sec.
> This covers most likely usages on the client side (forms and datefield) and would make shorter code.
> (I feel that prototype is bloated already so another 10K does not look apealing)
> Not to complicate things and optimize too soon, full lib can be used now,
> and later along with "multiple js lib support" the short version should be made available and pushed as default.
> while talking about dates... date format should be in message catalog so it is locale specific.
> for example in my language date format is: dd.MM.yyyy
> there should be different keys for server side format and client side format
> (the formats should be compatible of course)
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=MM/dd/yyyy
> (which are sam in case we use forementioned lib)
> or, if one would choose to use the former date picker i would be:
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=%m.%d.%Y
> I feel strongly about this being global key instead parameter for
> datefield, but even if it is only for date-field there should be two formats (server and js)
> in the end... the formater should be used to test validity for the field on the client side
> or regexp added to message catalog
> tapestry-date-format-js-regex=...complex or simple regex......
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-2198) Date formating global support
Posted by "Geoff Callender (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12572454#action_12572454 ]
Geoff Callender commented on TAPESTRY-2198:
-------------------------------------------
I wouldn't restrict the formatting info to message catalogs - I'd like it to be a parameter on the component. I've worked on data-entry systems pre-Java where the display format is a user-level option, eg. ddMMMyy (26FEB08) vs dd/MM/yy (26/02/08) vs dd/MM/yyyy (26/02/2008). This is something users appreciate.
It's worth noting too that the format that suits users in DateField is often different to the format they like to see in list output, eg. yyyy-MM-dd is popular when the user needs to be able to quickly compare dates in a list.
As for inputting into a DateField, it would be nice to be able to plug in your own parsing (ie. easily able to extend DateField and override the input parsing) to allow whatever rules you like - in data-entry entry it's nice to be able to enter ddMMyy or even ddMM and have it displayed back in one of the above formats. In trading rooms they even like stuff like 1m, meaning today plus 1 month.
The difficult I've had with extending Tapestry's date pickers to date is that they've used private fields without public getters and setters, and often the methods are final.
> Date formating global support
> -----------------------------
>
> Key: TAPESTRY-2198
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2198
> Project: Tapestry
> Issue Type: Improvement
> Affects Versions: 5.0.11
> Reporter: Davor Hrg
>
> there is a javascript implementation of
> SimpleDateFormat and is apache 2.0 licensed
> http://www.timdown.co.uk/code/simpledateformat.php
> it implements most of:
> http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
> It is 8.7 Kb with stripped comments.
> I'm looking at making a trimmed down version that can parse/format only numeric date parts : day, month, year, dour, min sec.
> This covers most likely usages on the client side (forms and datefield) and would make shorter code.
> (I feel that prototype is bloated already so another 10K does not look apealing)
> Not to complicate things and optimize too soon, full lib can be used now,
> and later along with "multiple js lib support" the short version should be made available and pushed as default.
> while talking about dates... date format should be in message catalog so it is locale specific.
> for example in my language date format is: dd.MM.yyyy
> there should be different keys for server side format and client side format
> (the formats should be compatible of course)
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=MM/dd/yyyy
> (which are sam in case we use forementioned lib)
> or, if one would choose to use the former date picker i would be:
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=%m.%d.%Y
> I feel strongly about this being global key instead parameter for
> datefield, but even if it is only for date-field there should be two formats (server and js)
> in the end... the formater should be used to test validity for the field on the client side
> or regexp added to message catalog
> tapestry-date-format-js-regex=...complex or simple regex......
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-2198) Date formating global support
Posted by "Geoff Callender (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587448#action_12587448 ]
Geoff Callender commented on TAPESTRY-2198:
-------------------------------------------
I think that for T5.0 to go final it must, at least, support the "format" attribute. Most of the world does not use USA-style formatting, so it's essential that all standard components take this into account if T5.0 wants to be taken seriously. Otherwise T5.0 runs the risk of being labelled "immature" and people will turn their backs on it.
> Date formating global support
> -----------------------------
>
> Key: TAPESTRY-2198
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2198
> Project: Tapestry
> Issue Type: Improvement
> Affects Versions: 5.0.11
> Reporter: Davor Hrg
>
> there is a javascript implementation of
> SimpleDateFormat and is apache 2.0 licensed
> http://www.timdown.co.uk/code/simpledateformat.php
> it implements most of:
> http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
> It is 8.7 Kb with stripped comments.
> I'm looking at making a trimmed down version that can parse/format only numeric date parts : day, month, year, dour, min sec.
> This covers most likely usages on the client side (forms and datefield) and would make shorter code.
> (I feel that prototype is bloated already so another 10K does not look apealing)
> Not to complicate things and optimize too soon, full lib can be used now,
> and later along with "multiple js lib support" the short version should be made available and pushed as default.
> while talking about dates... date format should be in message catalog so it is locale specific.
> for example in my language date format is: dd.MM.yyyy
> there should be different keys for server side format and client side format
> (the formats should be compatible of course)
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=MM/dd/yyyy
> (which are sam in case we use forementioned lib)
> or, if one would choose to use the former date picker i would be:
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=%m.%d.%Y
> I feel strongly about this being global key instead parameter for
> datefield, but even if it is only for date-field there should be two formats (server and js)
> in the end... the formater should be used to test validity for the field on the client side
> or regexp added to message catalog
> tapestry-date-format-js-regex=...complex or simple regex......
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-2198) Date formating global support
Posted by "Davor Hrg (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12572467#action_12572467 ]
Davor Hrg commented on TAPESTRY-2198:
-------------------------------------
I agree with these ideas, as I've also implemented less strict date parsing in some apps it felt more productive to enter adtes that way.....
my proposal is not restricting the formats to catalog, the parameter should stay,
but setting default format in catalog so it is different for different locale,
and not having date format hardcoded into datefield.
Because, currently to have consistent date behavior I need to override too many things.
to summarize:
default date behavior should depend on locale,
date format should be overridable (so user specific setting can apply)
datefield shold still have format parameter
to smmarize: dates are used in following:
server output
server-datefield encodes for client
client-datefield decodes to display calendar
client-datefield encodes selected date
cleint-form validates date (onchange event could be used to enable less strict date input, or a tapestry function overriden)
server-form validates input
server-datefield decodes value
maybe date formating should be made a service, so user settings overrides can be implemented.
> Date formating global support
> -----------------------------
>
> Key: TAPESTRY-2198
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2198
> Project: Tapestry
> Issue Type: Improvement
> Affects Versions: 5.0.11
> Reporter: Davor Hrg
>
> there is a javascript implementation of
> SimpleDateFormat and is apache 2.0 licensed
> http://www.timdown.co.uk/code/simpledateformat.php
> it implements most of:
> http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
> It is 8.7 Kb with stripped comments.
> I'm looking at making a trimmed down version that can parse/format only numeric date parts : day, month, year, dour, min sec.
> This covers most likely usages on the client side (forms and datefield) and would make shorter code.
> (I feel that prototype is bloated already so another 10K does not look apealing)
> Not to complicate things and optimize too soon, full lib can be used now,
> and later along with "multiple js lib support" the short version should be made available and pushed as default.
> while talking about dates... date format should be in message catalog so it is locale specific.
> for example in my language date format is: dd.MM.yyyy
> there should be different keys for server side format and client side format
> (the formats should be compatible of course)
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=MM/dd/yyyy
> (which are sam in case we use forementioned lib)
> or, if one would choose to use the former date picker i would be:
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=%m.%d.%Y
> I feel strongly about this being global key instead parameter for
> datefield, but even if it is only for date-field there should be two formats (server and js)
> in the end... the formater should be used to test validity for the field on the client side
> or regexp added to message catalog
> tapestry-date-format-js-regex=...complex or simple regex......
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-2198) Date formating global support
Posted by "Filip S. Adamsen (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624493#action_12624493 ]
Filip S. Adamsen commented on TAPESTRY-2198:
--------------------------------------------
http://www.timdown.co.uk/code/simpledateformat.php (from the issue description) won't work?
> Date formating global support
> -----------------------------
>
> Key: TAPESTRY-2198
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2198
> Project: Tapestry
> Issue Type: Improvement
> Affects Versions: 5.0.11
> Reporter: Davor Hrg
> Assignee: Howard M. Lewis Ship
>
> there is a javascript implementation of
> SimpleDateFormat and is apache 2.0 licensed
> http://www.timdown.co.uk/code/simpledateformat.php
> it implements most of:
> http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
> It is 8.7 Kb with stripped comments.
> I'm looking at making a trimmed down version that can parse/format only numeric date parts : day, month, year, dour, min sec.
> This covers most likely usages on the client side (forms and datefield) and would make shorter code.
> (I feel that prototype is bloated already so another 10K does not look apealing)
> Not to complicate things and optimize too soon, full lib can be used now,
> and later along with "multiple js lib support" the short version should be made available and pushed as default.
> while talking about dates... date format should be in message catalog so it is locale specific.
> for example in my language date format is: dd.MM.yyyy
> there should be different keys for server side format and client side format
> (the formats should be compatible of course)
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=MM/dd/yyyy
> (which are sam in case we use forementioned lib)
> or, if one would choose to use the former date picker i would be:
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=%m.%d.%Y
> I feel strongly about this being global key instead parameter for
> datefield, but even if it is only for date-field there should be two formats (server and js)
> in the end... the formater should be used to test validity for the field on the client side
> or regexp added to message catalog
> tapestry-date-format-js-regex=...complex or simple regex......
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-2198) Date formating global support
Posted by "Vjeran Marcinko (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608981#action_12608981 ]
Vjeran Marcinko commented on TAPESTRY-2198:
-------------------------------------------
I would also like to vote for proper date translatr/format support since it is quite essential.
I guess this would be implied by the solution, but it would be best to have possibility to display any kind of SimpleDateFormat pattern, even the portion that presents minute/second portion (ie. yyyy/MM/dd HH:mm)
In this way in Tapestry 4, I have reused DatePicker as "TimestampPicker" that is often needed -> JavaScript widget is used to pick date portion, and user is free to enter minute/second portion in rest of text field if needed.
BTW, I think http://issues.apache.org/jira/browse/TAPESTRY-2304 is related to this issue.
> Date formating global support
> -----------------------------
>
> Key: TAPESTRY-2198
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2198
> Project: Tapestry
> Issue Type: Improvement
> Affects Versions: 5.0.11
> Reporter: Davor Hrg
>
> there is a javascript implementation of
> SimpleDateFormat and is apache 2.0 licensed
> http://www.timdown.co.uk/code/simpledateformat.php
> it implements most of:
> http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
> It is 8.7 Kb with stripped comments.
> I'm looking at making a trimmed down version that can parse/format only numeric date parts : day, month, year, dour, min sec.
> This covers most likely usages on the client side (forms and datefield) and would make shorter code.
> (I feel that prototype is bloated already so another 10K does not look apealing)
> Not to complicate things and optimize too soon, full lib can be used now,
> and later along with "multiple js lib support" the short version should be made available and pushed as default.
> while talking about dates... date format should be in message catalog so it is locale specific.
> for example in my language date format is: dd.MM.yyyy
> there should be different keys for server side format and client side format
> (the formats should be compatible of course)
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=MM/dd/yyyy
> (which are sam in case we use forementioned lib)
> or, if one would choose to use the former date picker i would be:
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=%m.%d.%Y
> I feel strongly about this being global key instead parameter for
> datefield, but even if it is only for date-field there should be two formats (server and js)
> in the end... the formater should be used to test validity for the field on the client side
> or regexp added to message catalog
> tapestry-date-format-js-regex=...complex or simple regex......
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-2198) Date formating global support
Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625227#action_12625227 ]
Howard M. Lewis Ship commented on TAPESTRY-2198:
------------------------------------------------
Davor -- using Ajax to do formatting/parsing on the server side is the solution I've checked in. In the future, we may adapt that JS into a client library that is compatible with Java's SimpleDateFormat for performance reasons.
> Date formating global support
> -----------------------------
>
> Key: TAPESTRY-2198
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2198
> Project: Tapestry
> Issue Type: Improvement
> Affects Versions: 5.0.11
> Reporter: Davor Hrg
> Assignee: Howard M. Lewis Ship
>
> there is a javascript implementation of
> SimpleDateFormat and is apache 2.0 licensed
> http://www.timdown.co.uk/code/simpledateformat.php
> it implements most of:
> http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
> It is 8.7 Kb with stripped comments.
> I'm looking at making a trimmed down version that can parse/format only numeric date parts : day, month, year, dour, min sec.
> This covers most likely usages on the client side (forms and datefield) and would make shorter code.
> (I feel that prototype is bloated already so another 10K does not look apealing)
> Not to complicate things and optimize too soon, full lib can be used now,
> and later along with "multiple js lib support" the short version should be made available and pushed as default.
> while talking about dates... date format should be in message catalog so it is locale specific.
> for example in my language date format is: dd.MM.yyyy
> there should be different keys for server side format and client side format
> (the formats should be compatible of course)
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=MM/dd/yyyy
> (which are sam in case we use forementioned lib)
> or, if one would choose to use the former date picker i would be:
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=%m.%d.%Y
> I feel strongly about this being global key instead parameter for
> datefield, but even if it is only for date-field there should be two formats (server and js)
> in the end... the formater should be used to test validity for the field on the client side
> or regexp added to message catalog
> tapestry-date-format-js-regex=...complex or simple regex......
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-2198) Date formating global support
Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624524#action_12624524 ]
Howard M. Lewis Ship commented on TAPESTRY-2198:
------------------------------------------------
It's close, but needs to be hacked a bit, because its set up for PHP's date formats codes, that don't quite line up with Java's.
> Date formating global support
> -----------------------------
>
> Key: TAPESTRY-2198
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2198
> Project: Tapestry
> Issue Type: Improvement
> Affects Versions: 5.0.11
> Reporter: Davor Hrg
> Assignee: Howard M. Lewis Ship
>
> there is a javascript implementation of
> SimpleDateFormat and is apache 2.0 licensed
> http://www.timdown.co.uk/code/simpledateformat.php
> it implements most of:
> http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
> It is 8.7 Kb with stripped comments.
> I'm looking at making a trimmed down version that can parse/format only numeric date parts : day, month, year, dour, min sec.
> This covers most likely usages on the client side (forms and datefield) and would make shorter code.
> (I feel that prototype is bloated already so another 10K does not look apealing)
> Not to complicate things and optimize too soon, full lib can be used now,
> and later along with "multiple js lib support" the short version should be made available and pushed as default.
> while talking about dates... date format should be in message catalog so it is locale specific.
> for example in my language date format is: dd.MM.yyyy
> there should be different keys for server side format and client side format
> (the formats should be compatible of course)
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=MM/dd/yyyy
> (which are sam in case we use forementioned lib)
> or, if one would choose to use the former date picker i would be:
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=%m.%d.%Y
> I feel strongly about this being global key instead parameter for
> datefield, but even if it is only for date-field there should be two formats (server and js)
> in the end... the formater should be used to test validity for the field on the client side
> or regexp added to message catalog
> tapestry-date-format-js-regex=...complex or simple regex......
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-2198) Date formating global support
Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-2198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624477#action_12624477 ]
Howard M. Lewis Ship commented on TAPESTRY-2198:
------------------------------------------------
The pain here is that a server-side format must be carried over to the client, and must be formatted there. And parsed there ... that's the hard part. If the user enters text into the field then clicks the popup button, we should then parse the text field and raise the date popup.
I'm trying to find a library with a compatible license that does all that.
> Date formating global support
> -----------------------------
>
> Key: TAPESTRY-2198
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2198
> Project: Tapestry
> Issue Type: Improvement
> Affects Versions: 5.0.11
> Reporter: Davor Hrg
> Assignee: Howard M. Lewis Ship
>
> there is a javascript implementation of
> SimpleDateFormat and is apache 2.0 licensed
> http://www.timdown.co.uk/code/simpledateformat.php
> it implements most of:
> http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
> It is 8.7 Kb with stripped comments.
> I'm looking at making a trimmed down version that can parse/format only numeric date parts : day, month, year, dour, min sec.
> This covers most likely usages on the client side (forms and datefield) and would make shorter code.
> (I feel that prototype is bloated already so another 10K does not look apealing)
> Not to complicate things and optimize too soon, full lib can be used now,
> and later along with "multiple js lib support" the short version should be made available and pushed as default.
> while talking about dates... date format should be in message catalog so it is locale specific.
> for example in my language date format is: dd.MM.yyyy
> there should be different keys for server side format and client side format
> (the formats should be compatible of course)
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=MM/dd/yyyy
> (which are sam in case we use forementioned lib)
> or, if one would choose to use the former date picker i would be:
> tapestry-date-format-server=MM/dd/yyyy
> tapestry-date-format-js=%m.%d.%Y
> I feel strongly about this being global key instead parameter for
> datefield, but even if it is only for date-field there should be two formats (server and js)
> in the end... the formater should be used to test validity for the field on the client side
> or regexp added to message catalog
> tapestry-date-format-js-regex=...complex or simple regex......
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org