Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Date formatting of columns very slow.
guttorm
Junior Member

Posts: 2
Registered: 2/22/2007
Location: Norway
Member Is Offline
posted on 2/22/2007 at 02:50 PM Reply With Quote
Date formatting of columns very slow.


Hi

I was using date formatting of a column, like this

{
'name': 'NorwegianNameOfColumn',
'type': DATE,
'format_input': 'Y-m-d H:i:s',
'format_output': 'd/m/Y H:i'
}

The dates are then formatted to a format we use in Norway.

But the problem is, having about a 2800 rows in a table, the Javascript took too long. After a few seconds, the browser came up with a message asking if I want to terminate the script or let it continue. I clicked continue 3-4 times before it was finished.

So I changed it to
{
'name': 'NorwegianNameOfColumn',
'type': STR
}

Now the page loads instantly. But the dates are like they are in the database. I can convert to a Norwegian format on the server very fast, but then sorting by date gets messed up.

Is there a better solution to this problem?
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 2/22/2007 at 08:22 PM Reply With Quote

Maybe if the format filters were hard coded the conversion would work faster, but this requires the modification of the script's code. Please submit a support ticket with the customization request if you're interested in getting the quote.
View User's Profile View All Posts By User U2U Member
guttorm
Junior Member

Posts: 2
Registered: 2/22/2007
Location: Norway
Member Is Offline
posted on 2/23/2007 at 11:47 AM Reply With Quote

Hi

Thank you, but I don't think hardcoding will be neccessary. I guess we can live with dates in the database format.

But I have a feature request for future versions. I looked in my Javascript book, and found it has a system for date handeling. Maybe add a column type "JSDATE" or something?

In the data array, I could then just add something like
new Date(year,month,day,hours,minutes,seconds,ms)
or
new Date(dateString)
or
new Date(milliseoncs)

For outputting the date, maybe a simple call to Date.toLocaleString()?

I think this would be a lot faster than how the date formatting is done now.
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 2/23/2007 at 08:40 PM Reply With Quote

We do use Date object to sort the values. But we need to convert the string to Date object first (that's what new Date(year,month,day,hours,minutes,seconds,ms) does) so it can be compared with others, then we need to generate the string again. This is what takes time.
View User's Profile View All Posts By User U2U Member
brotherjames
Junior Member

Posts: 4
Registered: 3/9/2007
Location: Missouri
Member Is Offline
posted on 3/10/2007 at 03:09 AM Reply With Quote
Norwegian Date Formatting


Just a thought is there a way that you can create a View at the the Server level that uses the server to do the date reformatting and you just reference the view as a table?
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 3/10/2007 at 06:37 AM Reply With Quote

The thing is that we want to keep it pure client side script. With all the data pushed back and forth it defeats the purpose.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Simple
XP-styled
3D designed
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004