ThaiCalendar Format() with i18n

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

ThaiCalendar Format() with i18n

Postby Theprasit » April 24th, 2013, 9:42 am

I'm using i18n for ThaiCalendar and want to use Format() function to convert Date in String format.

I tried with ShowMessage(ThaiCalandar.Format('dd mmmm yyyy', Date) but the result shown only date and year portion without long month name.

Do I miss somethings?

Regards,

TS
Theprasit
Active Member
Active Member
 
Posts: 5
Joined: April 24th, 2013, 9:21 am

Re: ThaiCalendar Format() with i18n

Postby Kambiz » April 26th, 2013, 7:50 pm

I suppose that you have created the calendar instance as
Code: Select all
ThaiCalendar := TThaiCalendar.Create;
This constructor does not initialize the locale settings and only offers the algorithm of the calendar.

You should either pass a locale ID/Name to the constructor or later call Prepare method of Settings property of the calendar object.

Code: Select all
TThaiCalendar.Create('th-TH')

OR

Code: Select all
ThaiCalendar := TThaiCalendar.Create;
ThaiCalendar.Settings.Prepare('th-TH');
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: ThaiCalendar Format() with i18n

Postby Theprasit » April 28th, 2013, 2:34 pm

You are great!

I did what you mentioned, after change to your method it's work fine.

Thank you for your help and your wonderful component.

TS
Theprasit
Active Member
Active Member
 
Posts: 5
Joined: April 24th, 2013, 9:21 am


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 2 guests