Date formate issue-Cant select date with a year less than 1900

Hi

I am using AX 2009 and I implemented Hijri date option in HR module.

But i cant select a date with a year less than 1900.

I checked for Gregorian foramte,It is also giving the error message

Errors in the date formats

Enter the date as DD/MM/YYYY

How can I solve this issues?

you used the transdate EDT for this? if yes, it will not allow you to enter the date below 01/01/1900.

if you want to enter less than 1900 year you have to enter the date manually i think. because transdate EDT will not accept th edate below 1900 year.

Hi Ven

Thanks for your reply

In all standared date control it is taking the date having the year greater than 1900 ,even if I enter manually.

Regards

ya you are right… it will take greater than 1900 only but not less than 1900.

i am right?

01\01\1900 is considered as null date, it will accept only the dates after it…

Hi Kranthi,

Thanks for your quick reply but how can I modify this date range?

Regards

Hi,

As Kranthi mentioned -

  • The minimum date in AX is 01\01\1900 (this is also considered as null value).
  • And the maximum date date is 31\12\2154

Are you trying to convert Gregorian to Hijri date? Are you using CalendarConverter class?

Hi Harish,

Thanks for your reply

I am trying to convert Gregorian to Hijri Date for HRM

In Employee details form i want work permit date in Hijiri format .

Regards

Hi,

I have never worked with Hijri dates before. So please take a job below with a pinch of salt. But I guess this is one way in which Gregorian dates could be converted to Hijri format through code.


static void testHijriDate(Args _args)
{

TransDate dt;
int HijriDt;
int HijriMonth;
str Yr;

CalendarConverter CalendarConverter;
;

dt = 01\01\2011;
CalendarConverter = new CalendarConverter(PreferredCalendar::Hijri);
HijriDt = CalendarConverter.dayofmth(dt);
HijriMonth = CalendarConverter.mthofyr(dt);
Yr = CalendarConverter.yearStr(dt);

info(strFmt(‘Hijri day %1 - month %2 - Year %3’, HijriDt, HijriMonth, Yr));
}