Welcome Guest Search | Active Topics | Sign In | Register

EO.Web DatePicker - Swedish Options
Brian Brown
Posted: Wednesday, April 11, 2012 10:40:49 AM
Rank: Member
Groups: Member

Joined: 4/9/2010
Posts: 12
I have a web form that contains a couple of datepickers but when working in the Swedish language they aren't showing the correct information.

For example, todays date in FullDateTimePattern should read: "den 11 april 2012" but it reads "'11en '11 april 2012'"

The letter D at the beginning is always replaced with the number of the current date, no matter what date format I'm using.

Suggestions?
eo_support
Posted: Wednesday, April 11, 2012 12:55:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Please post a sample page that demonstrates the problem and we will take a look. Note that if the problem is in your code, then you will need to resolve that yourself since the free support for your order has long expired.

Thanks!
Brian Brown
Posted: Wednesday, April 11, 2012 12:59:15 PM
Rank: Member
Groups: Member

Joined: 4/9/2010
Posts: 12
Default.aspx:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="SwedishTest._Default" %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<eo:DatePicker ID="DatePicker1" runat="server">
</eo:DatePicker>
<br />
<br />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>


Default.aspx.vb

Partial Public Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
DatePicker1.SelectedDate = Date.Today
DatePicker1.PickerFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern

TextBox1.Text = Date.Today.ToString(System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern)
End Sub
End Class
Brian Brown
Posted: Wednesday, April 11, 2012 1:00:29 PM
Rank: Member
Groups: Member

Joined: 4/9/2010
Posts: 12
Also - make sure in IIS under .NET Globalization that you change your culture and UI culture to use: Swedish (Sweden) (sv-SE)
eo_support
Posted: Wednesday, April 11, 2012 1:27:32 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You cannot use it that way. DatePicker's PickerFormat does not recognize literal string delimiters. So any letter occurs inside the delimiters that matches the special characters will still be processed. You can try to parse the format to remove the literals from the format first. We will also see if we can support that in a future version.

Thanks!
Brian Brown
Posted: Wednesday, April 11, 2012 1:34:01 PM
Rank: Member
Groups: Member

Joined: 4/9/2010
Posts: 12
I'm not sure what you mean by "You cannot use it that way.". Are you referring to the Swedish (Sweden) (sv-SE) culture, or the LongDatePattern picker format?
eo_support
Posted: Wednesday, April 11, 2012 1:42:26 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
DatePicker.PickerFormat DOES NOT support all delimiters .NET supports. You can take a look of our documentation to see what delimiters are supported (for example, we support "yyyy", "mm", "dd" and such). So if the format you pass in contains any delimiters that the DatePicker does not support, then the result will be different. The default Swedish.LongDatePattern happens to contain literal delimiters (the 'den ' part) which we do not support.

To put it in plain words, the notion that you can pass any valid .NET date format string to DatePicker.PickerFormat is wrong. This is because .NET date format is only implemented on the server side on the server side, whereas for the DatePicker it has to work both on server side and client side. So whatever format has to be implemented by us on the client side in the same manner as .NET implemented on the server side in order for it to work the same way as .NET does. Currently we only implemented the some of it, not all of it.

Hope this clears up.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.