Closed iballan closed 6 years ago
Thanks for your comment, you can pull this change now. you can set it using mcv_calendarDiff app:mcv_calendarDiff="2" app:mcv_calendarDiff="1" app:mcv_calendarDiff="0" (default value) app:mcv_calendarDiff="-1" app:mcv_calendarDiff="-2"
I actually tried to modify the code to have this feature but could not manage to get it working proporely. Will it be added before Ramadan ?
Yes, In the next few days.
Great ! Barakallahu fik
Any news about this issue ?
Was this feature added? I also want to adjust dates +- upto 3.
@eltohamy Any news about this issue ?
Thanks for your comment,the issue is fixed.You can pull this change now. you can set it setting mcv_calendarDiff attribute in layout xml. app:mcv_calendarDiff="2" app:mcv_calendarDiff="1" app:mcv_calendarDiff="0" (default value) app:mcv_calendarDiff="-1" app:mcv_calendarDiff="-2"
Great 👍 Jazakallahu Khair It can be modified programmatically as well right ?
Hello, i actually want to know this as well, can we modify it programatically?
@eltohamy , can you provide an answer please?
hey @iballan, i was messing with the code, i created a setter for calendarDiff, but didn't work, i tried even to comment out line 247 in MaterialHijriCalendarView class, maybe that value would override my setter, but also nothing, i got an idea to actually create 5 layouts, each with calendarView with different value for "app:mcv_calendarDiff", but then, i went back to line 247, and i saw the 0 as default value like, if the value isn't set in xml, it would be 0, in there, i gave it "context.getSharedPreferences....." and in my settings i save the offset of hijri date in SharedPreferences, now it is working like a charm.
Hope my comment helps you out.
can we find app:mcv_calendarDiff value for different location programatically? for example in Pakistan, India and Bangladash it will be -1. and for some places it will be 0. How can we find the app:mcv_calendarDiff value programatically?
In some countries the date is calculated depending on the moon position. In this cases, user may have to fix it by specifying a days to be added to the date to fix the calendar: +2 +1 0 -1 -2