keyrunHORNET / date_picker_converter

Nepali Date Picker with Date conversion from BS to AD and vice-versa
Apache License 2.0
36 stars 23 forks source link

calendar month is not showing properly #8

Closed imsabin closed 5 years ago

imsabin commented 6 years ago

hi, when implementing this library, there is an issue of displaying month. sometimes it is showing correctly n sometimes there is an issue like the previous month is ashoj and the next month is also displayed as ashoj and then mangsir.

keyrunHORNET commented 5 years ago

Thank you for pointing this out.

Ive checked it and you are right. But it can go unnoticed to most users. That was a lame excuse.

However due to some rough schedule i am following right now, i dont think i can fix it soon. But i will in near future. So i will leave this issue open, until solved.

If anyone is interested in contributing to this library. Hit some pull request.

I will have their info as per request in the list of contributors.

sujanmt commented 5 years ago

This issue has been fixed @keyrunHORNET just needed to change in MonthView.class in below function:- private String getMonthAndYearString() { Log.d("MonthName", String.valueOf(getYear())); return getResources().getString(DateConverter.getNepaliMonthString(getMonth()))

Instead of this: @NonNull private String getMonthAndYearString() {

    //here the string for month view is returned i.e "MMMM YYYY" on top of every month

    /*Locale locale = Locale.getDefault();
    String pattern = "MMMM yyyy";
    if(Build.VERSION.SDK_INT < 18) pattern = getContext().getResources().getString(R.string.mdtp_date_v1_monthyear);
    else pattern = DateFormat.getBestDateTimePattern(locale, pattern);
    SimpleDateFormat formatter = new SimpleDateFormat(pattern, locale);
    formatter.applyLocalizedPattern(pattern);
    mStringBuilder.setLength(0);
    */
    //return formatter.format(mCalendar.getTime());
    return getResources().getString(DateConverter.getNepaliMonthString(mCalendar.get(Calendar.MONTH)))
            + " " + mCalendar.get(Calendar.YEAR);

}
keyrunHORNET commented 5 years ago

@sujanmt Thank you.

IT-Nepal commented 5 years ago

private String getMonthAndYearString() { //? where it locates

instead i have "dateConverter.getNepaliDate(now))"

how to solve repeating month issuese