Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

swing - non standard locale with java.util.Calendar -


we have customer in sweden, using software in english. set locale(en, sv). did hope calendar class adhere country settings, uses language , locale assumes settings.

so searching way let calendar know new firstdayofweek , minimumdayinfirstweek settings prefered standard way other setting manually , hardcoded.

for clarification: 29. august 2010 in sweden in cw 34 (also in germany , great britain) in reported cw 36. different results fact 01.01.2010 friday , 29.08.2010 sunday.

i cannot change language setting swedish , use english fallback since not support swedish language, sun/oracle/.. does, swing ui have mixture of swedish , english texts, not acceptable.

and adding properties file named "sun.util.resources.calendardata_en_sv.properties" not work out: not read! manually resourcebundle that's possible. somehow localedata.getcalendardata(locale) own magic in reading resourcfiles cannot find out since source of not available. method called here: java.util.calendar.setweekcountdata(locale).

i found java.util.spi package not provide access firstdayofweek , minimumdaysinfirstweek settings.

perhaps can try intercept calls resourcebundles , use default fallback english , let calls calendardata proceed!? sounds hacky.

for clueless ...

thx help!

ciao,

nils drews

package de.drews.i18n;  import java.util.calendar; import java.util.locale; import java.util.resourcebundle;  public class test {      /**      * @param args      */     public static void main(string[] args) {        // en_gb = 34        // en_us = 36        // sv_sv = 34        // en_sv = 36 --> wrong         printtest("en", "gb", 34);        printtest("en", "us", 36);        printtest("sv", "sv", 34);        printtest("en", "sv", 34);     }      private static void printtest(string language, string country, int expected) {        locale locale = new locale(language, country);         calendar cal = calendar.getinstance(locale);         cal.set(calendar.year, 2010);        cal.set(calendar.month, calendar.august);        cal.set(calendar.date, 29);         int actual = cal.get(calendar.week_of_year);         system.out.println(actual + "\t" + expected + "\t"         + ((actual == expected) ? "yeah!" : "-") + "\t" + language         + "\t" + country);     } } 

how using getinstance(timezone zone, locale alocale) providing timezone select calendar behaviour , locale define language?


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -