Technical support This forum is closed.
Version 1.x > Technical support > BUG: Calendar control date format View modes: 
User avatar
Member
Member
wtijsma - 2/9/2005 11:47:58 AM
   
BUG: Calendar control date format
Hi,

The date format on our ASPX server is different from the SQL Server (mixed US/European date formats). This causes problems with your calendar control, that throws exceptions, or worse, reverses month/day values in the form fields.

- I would like to use the universal date/time notation in these fields (yyyy-mm-dd).
- I'd like to be able to edit the dates myself, to be able to paste dates.
- When a date is already present, and the calendar control is opened, it jumps to today instead of the date that is already filled in.

Thanks, Wiebe

User avatar
Guest
admin - 2/10/2005 9:25:51 AM
   
Re: BUG: Calendar control date format
Hi Wiebe,

could you please write me what settings you have in the <globalization> section of the web.config and what is your preferred culture in the user's profile?

Generally, the calendar control returns date and time according to the current culture. The date and time is then saved through the query parameter, so it should work with any SQL Server settings.

Thank you.

User avatar
Member
Member
wtijsma - 2/10/2005 10:19:58 AM
   
Re: BUG: Calendar control date format
The culture is en-US, and the globalization section only contains

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />


I've replaced this in the browse/calendar.aspx.cs:

closeWindow(selTime.ToString("d"));

with

closeWindow(selTime.ToString("yyyy-MM-dd"));

and now it should work correctly in all cultures...

User avatar
Guest
admin - 2/10/2005 10:28:22 AM
   
Re: BUG: Calendar control date format
Hi Wiebe,

Thank you for details. Could you please write me what culture your web server uses by default?

Thank you.

User avatar
Member
Member
wtijsma - 2/10/2005 2:08:12 PM
   
Re: BUG: Calendar control date format
the default culture is en-US (I think)

However, now somewhere the date saving goes all wrong. I get the wrong month (00).

User avatar
Member
Member
wtijsma - 2/14/2005 9:07:36 AM
   
Re: BUG: Calendar control date format
It works now, I've replaced the date format everywhere with yyyy-MM-dd :-)

User avatar
Guest
admin - 2/20/2005 4:24:36 PM
   
Re: BUG: Calendar control date format
Hi Wiebe,

I believe we have just solved this. The current thread culture was not set during postback in the editing form which may have caused the problems. The nearest version will contain the fix, so you can try it. We prefer using the date and time format according to the user's preferred culture, since even the universal format may be understood in different ways in various countries.

Thank you for notifying us about this error.

User avatar
Member
Member
wtijsma - 2/21/2005 9:18:10 AM
   
Re: BUG: Calendar control date format
Great, that is the more elegant solution anyway, so fine with me...

User avatar
Member
Member
sciamannikoo - 2/28/2005 11:37:04 AM
   
Re: BUG: Calendar control date format
In effect, i think an editable textbox of this control is useful sometimes.
When I need to set a date far to current date/time, I prefer to edit manually, insted to move to several past o future days, months or years.
Also, this can be a problem, if user/editor edit a wrong forma date

User avatar
Member
Member
wtijsma - 2/28/2005 11:46:42 AM
   
Re: BUG: Calendar control date format
Agreed, but if a user doesn't know how to enter a date, it should just give a validation exception that could even tell him to use the datepicker, or enter the correct format. They can't mess up anything by entering an incorrect date (unless they switch month/day order, but you can just accept yyyy-MM-dd format to prevent this)

Now you're also preventing the users that do know how to enter a date or want to copy & paste it to speed things up.

I think in this case, the restriction to use the datepicker only limits functionality while it isn't necessary.

User avatar
Guest
admin - 2/28/2005 12:02:00 PM
   
Re: BUG: Calendar control date format
Hi Andrea and Wiebe,

Thank you for posting your suggestions here. I agree with you and we will solve this problem in the nearest release. I'm sorry if it causes any troubles to you.