Date sorting in htmltable

22 views
Skip to first unread message

axomat

unread,
May 20, 2012, 4:09:57 PM5/20/12
to clien...@googlegroups.com
I am using GB date formats dd/mm/yy but the date parser in htmltable screws up, I assume because it is trying to use the US date format. I have tried using Locale.use(\'en-GB\'); but no change. I just wanted to check that htmltable ought to pick up the locale.

Thanks for the clientcide libraries, I use them a lot and this is the only problem I have had with them.

Aaron Newton

unread,
May 21, 2012, 5:50:05 PM5/21/12
to clien...@googlegroups.com
1) this is now in MooTools More, so you should post questions about it in the MooTools User Group. I say this not because I don't want to be helpful, but because there's one of me here and loads of people there who can answer your questions and offer you help more quickly.

2) HtmlTable does not currently integrate with the localization. You'll have to re-author the date parser found in HtmlTable.Sort. This is pretty easy, check it out:

'date': {
match: /^\d{2}[-\/ ]\d{2}[-\/ ]\d{2,4}$/,
convert: function(){
var d = Date.parse(this.get('text').stripTags());
return (typeOf(d) == 'date') ? d.format('db') : '';
},
type: 'date'
},

I think you can figure out how to re-arrange things to match your content. Just use the HtmlTable.defineParsers mentioned in the docs to overwrite it.

On Sun, May 20, 2012 at 1:09 PM, axomat <andy.ba...@gmail.com> wrote:
I am using GB date formats dd/mm/yy but the date parser in htmltable screws up, I assume because it is trying to use the US date format. I have tried using Locale.use(\'en-GB\'); but no change. I just wanted to check that htmltable ought to pick up the locale.

Thanks for the clientcide libraries, I use them a lot and this is the only problem I have had with them.

--
You received this message because you are subscribed to the Google Groups "Clientcide" group.
To view this discussion on the web visit https://groups.google.com/d/msg/clientside/-/CvjKA98dMykJ.
To post to this group, send email to clien...@googlegroups.com.
To unsubscribe from this group, send email to clientside+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/clientside?hl=en.

Reply all
Reply to author
Forward
0 new messages