Closed freebumba27 closed 9 years ago
please use this function HijriCalendarDate.getSimpleDate(Calendar.getInstance(),"0") to get the hijri date for that calendar Date instance
@Override
public void onSelectDate(Date date, View view) {
Toast.makeText(getApplicationContext(), HijriCalendarDate.getSimpleDate(Calendar.getInstance(), 0), Toast.LENGTH_SHORT).show();
}
I am trying this but it's always giving today's Hijri date as toast. How can I get selected Hijri Date
Please wait a moment, i will construct the code for you and send you it
Assalamu Alaikum, Sahaab Zahid On Jul 14, 2015 1:57 AM, "Bumba" notifications@github.com wrote:
@Overridepublic void onSelectDate(Date date, View view) {Toast.makeText(getApplicationContext(), HijriCalendarDate.getSimpleDate(Calendar.getInstance(), 0), Toast.LENGTH_SHORT).show(); }
I am trying this but it's always giving current Hijri date as toast. How can I get selected Hijri Date
— Reply to this email directly or view it on GitHub https://github.com/sahaab/HijriCalendar-master/issues/1#issuecomment-121139129 .
That will be really helpful.
public static Calendar DateToCalendar(Date date){
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal;
}
@Override
public void onSelectDate(Date date, View view) {
Toast.makeText(getApplicationContext(),
HijriCalendarDate.getSimpleDate(DateToCalendar(date), 0),
Toast.LENGTH_SHORT).show();
}
Work like charm.. Thanks I have modified little bid, It looks like this -
@Override
public void onSelectDate(Date date, View view) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
Toast.makeText(getApplicationContext(), HijriCalendarDate.getSimpleDate(cal, 0), Toast.LENGTH_SHORT).show();
}
No problem :D , glad to help and yep that is fine, if you like, you may email me your app when you are done, I would love to see it inshaAllah :D
It have modified couple of things It's look like this.
On clicking on the date it's showing the Georgian Calendar date. I want to show Hijri date. How to do that?