Asked by:
Date names

Question
-
User305162745 posted
is there any way to change the date code for different regions or is that something you have to to on the server ? ?
basicly i need to change the date , the name of the month to my region :)
hope u under stand what i am talking about and yeas i am new at this :)
best regards
Saturday, February 25, 2006 2:56 PM
All replies
-
User305162745 posted
hmm maybe no one understand what i am talkin about :)
ok lets take this web site for exaple (hope its ok )
http://www.sharepoint.ch/events_calendar.aspx - when i look at this calender i get the name of the month´s in my language witch is icelandic but on my web site it only comes in english and i would like to change that with your help ;)
so pls if you know how let me know :)
best regards
Monday, March 6, 2006 8:20 PM -
User1052258516 posted
This is possible you will have to change the current culture within the actual EventCalender control. What you will have to do is download the control's code from the downloads section of this website, then open up the project file and modify the ItemsTemplate.cs file you will have to add the following code at the top after the other using statements:
using
System.Globalization;using
System.Threading;And then find the following method:
public
DataBoundCalendarHeader(DateTime VisibleDate)and add this code after the last line in that method:
Thread
.CurrentThread.CurrentCulture = new CultureInfo("is-IS");This will change the current culture info for the dates returned to "Icelandic - Iceland"
Wednesday, March 8, 2006 10:15 PM -
User305162745 posted
thx a lot :)
i will test this when i get home and i will let you know how it goes ;)
thx for everything
best regards
Thursday, March 9, 2006 10:00 AM -
User305162745 posted
hi
well i am trying this now but i am new to this :)
i have downloded the event control and modified the Item templets.cs
but what do i do next upload this file to the server ?
:) thx for all the help
best regards
Thursday, March 9, 2006 3:03 PM -
User1052258516 posted
In the project folder for the event calendar control there will be a bin folder with a Debug or Release folder in it. There should be an EventCalendar.dll file in there just after you Build the Solution. You would copy this file to the bin folder of your the Club Starter Kit and replace it. You probably want to make a copy of the existing EventCalendar.dll file before you do this and store it in a safe place just to be sure. You then can test it out and see if it works. If it does then simply upload that file to your server and replace the existing one.
Hope this helps... :)
Thursday, March 9, 2006 8:37 PM -
User305162745 posted
hey this works :) thx a lot you just made my day
just one more question :) :)
the news i write and stuff like thatt display the news date mm/dd/yy but i need it to display dd/mm/yy
is it hard to change this :)
again thx alot for your help
best regards from the land of ice and fire :)
Saturday, March 11, 2006 5:19 AM -
User1052258516 posted
Actually the code that I gave you can be implemented on each of your pages in the <script> tag by implementing the Page_Load sub and put the Thread.CurrentThread.CurrentCulture = New CultureInfo("is-IS") in there. This way all data that is displayed in some kind of control and has a specific data type (dates, currency, etc.) will be formatted properly by the Culture Info. So I believe that the dates for Icelandic would be in the format 11.3.2006 24h time. If you don't want this automatic formatting you can change the SQL code that returns the data and use the CONVERT function. Something like CONVERT(varchar(11), <DATE_FIELD_IN_DATABASE_NAME>, 103).Hope this helps
Saturday, March 11, 2006 3:24 PM -
User305162745 posted
i will look in to this
thanks for all your help :)
best regards
Sunday, March 12, 2006 4:12 PM -
User-1653776603 posted
If you wnat this for all the pages on your site, then the simplest solution is to modify web.config and add the following:
<
configuration><
system.web><
globalization culture="is-IS"/>This will change the culture for the whole site
Monday, March 13, 2006 12:38 PM -
User305162745 posted
hi hi and thx for the reply :)
well i get error on both methods , i tried this one now
<configuration>
<system.web>
<globalization culture="is-IS"/>
when i upload the file to the ftp server i just get error message i have to remove it to fix it again ??
after i set this in the file it comes like this
<
configuration> comes with red underlines<
system.web>and this on also<
globalization culture="is-IS"/> but not this oneand i also tryed to close the tag at the end but alwayse some error when i upload the file - i don´t know how to solve this :s
so what am i doing wrong :)
thx again for all the help
best regards
Monday, March 13, 2006 4:16 PM -
User305162745 posted
hey i figure it out :)my mistake was that i was adding a new line to web. config file but i just had to add lines into the globalization command , like this<
globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="is-IS" uiCulture="is-IS" />so basicly i just added culture="is-IS" uiCulture="is-IS"
well thx for all the help guys
best regards
Monday, March 20, 2006 5:08 PM