Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to get date format from the client side?
How to get date format from the client side? [message #1770538] Mon, 14 August 2017 07:10 Go to next message
David Lee is currently offline David LeeFriend
Messages: 78
Registered: May 2013
Member
Hi,

When users import their files(eg.EXCEL) containing DATE value into the RAP app, how to get each client user's date format string? Such as "MM/dd/yyyy" or "dd/MM/yyyy" and so on!

I can get client IP/Time zhone, but failed to get the date format string!

Thank you for help!


BEST,
David

[Updated on: Mon, 14 August 2017 07:20]

Report message to a moderator

Re: How to get date format from the client side? [message #1770544 is a reply to message #1770538] Mon, 14 August 2017 09:01 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
I don't think that this is possible in JS. Try to get the default (browser) locale with RWT.getLocale() and construct your Date formatter on the server.
HTH,
Ivan
Re: How to get date format from the client side? [message #1770605 is a reply to message #1770544] Mon, 14 August 2017 22:56 Go to previous message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
If it's an Excel file (XLS or XLSX, not CVS, etc) then the formatting for each date cell is stored in the file. The actual date value is stored in an XLS file as a floating point representing the number of days since 1900 (or 1904 if it's an old Excel for Mac).

A files date format also isn't necessarily going to match the locale value their browser is sending in the Accept-Language header.
A locale also only specifies a default date format. Doesn't mean the user is actually using that format.
Previous Topic:How to get date format from the client side?
Next Topic:Shell widget: minimize button in titlebar
Goto Forum:
  


Current Time: Fri Apr 26 12:35:20 GMT 2024

Powered by FUDForum. Page generated in 0.03488 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top