I am developing a java app in which I need to get a date and number of days from the user and then add this numbers to the date and show the final date which in this case would be the deadline date , to the user. The problem here is that I'm using shamsi(jalali) calendar and in order to the calculation , first I have to convert the shamsi date to java standar calendar then add the day numbers and again convert it back to shamsi date.
Date miladiDate = new Date(DateConvertor.shamsi2miladi(entity.getDoDate()));
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Calendar c = Calendar.getInstance();
c.setTime(miladiDate);
c.add(Calendar.DATE, baseEvaluate.getDeadLineDays());
String output = sdf.format(c.getTime());
System.out.println(output);
entityDetail.setDeadLineDate(DateConvertor.miladi2date(c.getTime()));
I wanted to know if there is a way in which I could do this without converting the shamsi date , and just add the day number to the shamsi date. P.S : I used joda time , it does not support the shamsi calendar.