Set Persian Date to TIntlDatePicker

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

Set Persian Date to TIntlDatePicker

Postby zavf » April 21st, 2014, 8:40 pm

Hi.

how to do set PersianDate to TIntlDatePicker?

I have using this code to IncDay and given Persian Date but i dont know firstly step set Persian (Jalali) Date

Code: Select all
function IncPersianDate(const PerDate: string;
  IncNumber: Word): string;
  var
   CalType: TCalendarClass;
   DateInc: TDate;
   Obji18n: TIntlDatePicker;
begin

  try
    Obji18n:= TIntlDatePicker.Create(nil);
    CalType:= CalendarTypes.ByIndex(3) {Jalali or Persian Calendar};
    Obji18n.CalendarType:= CalType;
    //Obji18n.Calendar.Format('q', DateInc);
    Obji18n.Calendar.IncDay(DateInc, IncNumber);
    Obji18n.Date:= DateInc;
    Result:= Obji18n.Calendar.Format('q', Obji18n.Date);
  finally
    FreeAndNil(Obji18n);
  end


end;


Using:

Code: Select all
Self.Caption:= IncPersianDate('1393/02/01', SpinEdit1.Value);


thanks mr kambiz
zavf
Member
Member
 
Posts: 1
Joined: April 21st, 2014, 8:29 pm

Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 5 guests

cron