Giter VIP home page Giter VIP logo

date_picker_converter's Introduction

Nepali Date picker Converter

This work is the derivative of Material Date Time Picker, in the original work, calender of a date picker is based on the Gregorian Calendar, but this tries to offer you a calendar based on Bikram Sambat. The library uses the code from the Material Date Time Picker as a base and tweaked it to fill the need for Nepali Calendar System with the extra feature of converting Gregorian(AD) date to Nepali(BS) and Vice versa.

Contributor

Jeffrey Jongko

Date Picker Calendar
Date Picker Calendar

demo (old version)

https://play.google.com/store/apps/details?id=com.hornet.nepalidateconverter

Setup

The easiest way:

Step 1. Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:

   allprojects {
		 repositories {
			  ...
			  maven { url "https://jitpack.io" }
		 }
	}

Step 2. Add the dependency

 dependencies {
	       implementation 'com.github.keyrunHORNET:date_picker_converter:$latest_version'
	}

You may also add the library as an Android Library to your project. All the library files live in library.

Using Calendar

include the calendar in your desired layout

 <com.hornet.dateconverter.CalendarView.Calendar
        android:id="@+id/calendar"
        android:layout_width="wrap_content"
        android:layout_height="300dp" />

In order to receive the date checked in the calendar, you will need to implement the CalendarView.Calendar.OnDateSetListener interface. This will be a the Activity or Fragment that creates the calendar in their respective layout. Then hook up the interface with calendar in your layout.

calendar.setOnDateSetListener(this);

@Override
   public void onDateClick(View calendar, int year, int month, int day) {
        Toast.makeText(this, "year :: " + year + "  month :: " + (month + 1) + " day :: " + day, Toast.LENGTH_SHORT).show();
   }

Using Date Picker / Time Picker

Implement an OnDateSetListener / OnTimeSetListener

In order to receive the date set in the picker, you will need to implement the OnDateSetListener interfaces. Typically this will be the Activity or Fragment that creates the Pickers. The callbacks use the same API as the standard Android pickers.

@Override
public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
  String date = "You picked the following date: "+dayOfMonth+"/"+(monthOfYear+1)+"/"+year;
  dateTextView.setText(date);
}
@Override
public void onTimeSet(RadialPickerLayout view, int hour, int minute, int second) {
  String time = "You picked the following time:- "+hour+":"+minute+":"+second;
  timeTextView.setText(time);
}

Create a DatePickerDialog / TimePickerDialog using the supplied factory

You will need to create a new instance of DatePickerDialog using the static newInstance() method, supplying proper default values and a callback. Once the dialogs are configured, you can call show().

DatePickerDialog dpd = DatePickerDialog.newInstance(MainActivity.this);
dpd.show(getFragmentManager(), "Datepickerdialog");

Using Date Converter

DateConverter dc=new DateConverter();

year month day when passed beyond the conversion range throws an IllegalArgumentException.

  • Converting english Date to Nepali date (i.e A.D to B.S):
getNepaliDate(int engYY,int engMM,int engDD);

you can also pass the calendar instance as an argument

  • Converting Nepali Date to English date (i.e B.S to A.D):
getEnglishDate(int nepYY,int nepMM,int nepDD);

Both of the above method returns the model of date. Model is a DTO with getter and setter for year month and day .

Example:

Model outputOfConversion=dc.getEnglishDate(nepYY,nepMM,nepDD);

int year=outputOfConversion.getYear();
int month=outputOfConversion.getMonth(); 
int day=outputOfConversion.getDay();

Additional Options

  • isEngDateInRange(int yy,int mm,int dd) this static method of class DateConverter returns true if english date is within the range of conversion.

  • isNepDateInRange(int yy,int mm,int dd) this static method of class DateConverter returns true if nepali date is within the range of conversion.

  • getFirstWeekDayMonth(int yy,int mm) public method of class DateConverter returns int range from 1-7 the starting week day of a given month in given nepali year.

  • noOfDaysInMonth(int yy,int mm) public method of class DateConverter returns the no of days int in a particular month of a given nepali year.

  • convertModelToCalendar(Model dateModel) public method of class DateConverter returns Gregorian Calendar

  • convertCalendarToModel(Calendar dateModel) public method of class DateConverter returns Nepali date Model

  • getTodayNepaliDate() public method of class DateConverter returns Nepali Date Model

  • getWeekDay(int nepYY, int nepMM, int nepDD) public method of class DateConverter returns int [1-7] representing seven days of week

  • DatePickerDialog dark theme The DatePickerDialog has a dark theme that can be set by calling

dpd.setThemeDark(true);
  • setAccentColor(String color) and setAccentColor(int color) Set the accentColor to be used by the Dialog. The String version parses the color out using Color.parseColor(). The int version requires a ColorInt bytestring. It will explicitly set the color to fully opaque.

  • DatePickerDialog setTitle(String title) Shows a title at the top of the DatePickerDialog

  • showYearPickerFirst(boolean yearPicker)
    Show the year picker first, rather than the month and day picker.

  • setScrollOrientation(int orientation) change the scroll orientation of the picker.

  • setVersion(int version) choose between two versions of picker.

  • setMinDate(Model minDate) enable only dates after minDate for selection in picker.

  • setMaxDate(Model maxDate) disable all dates after maxDate for selection in picker.

  • setHighlightedDays(List<Model> days) highlight all the days provided in the ArrayList of model, as an argument.

  • setSelectableDays(List<Model> days) only the days provided in the ArrayList of model, as an argument can be selected in picker, all other dates are disabled.

  • setDisabledDays(List<Model> days) days provided in the ArrayList of model, as an argument can not be selected in picker, all other dates are enabled.

  • dismissOnPause(boolean dismissOnPause)
    Set whether the picker dismisses itself when the parent Activity is paused or whether it recreates itself when the Activity is resumed.

FAQ

Why Date Model instead of Java Calendar

In java Calendar class DAY_OF_MONTH cant be assigned to 32, and throws an IllegalArgumentError,but in Bikram Sambat Calendar system we have DAY_OF_MONTH with the value of 32 in several month.

Why does the DatePickerDialog and DateConverter return the selected month -1?

In the java Calendar class months use 0 based indexing: January is month 0, December is month 11. This convention is widely used in the java world, for example the native Android DatePicker.And in Nepali Calendar Baisakh is month 0, Chaitra is month 11.

License

Copyright (c) 2016 Kiran Gyawali

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Heads Up

  • input argument on conversion method ==> month starts from 1 and ends at 12
  • output of conversion ==> month starts from 0 and ends at 11

date_picker_converter's People

Contributors

keyrunhornet avatar sanjayadhikari-007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

date_picker_converter's Issues

NullPointerException

When system date is 2019-05-01, dpd.show() causes an error

java.lang.NullPointerException: Attempt to read from null array
at com.hornet.dateconverter.DateConverter.getFirstWeekDayMonth(DateConverter.java:640)
at com.hornet.dateconverter.DatePicker.MonthView.setMonthParams(MonthView.java:396)
at com.hornet.dateconverter.DatePicker.MonthAdapter$MonthViewHolder.bind(MonthAdapter.java:292)
at com.hornet.dateconverter.DatePicker.MonthAdapter.onBindViewHolder(MonthAdapter.java:222)
at com.hornet.dateconverter.DatePicker.MonthAdapter.onBindViewHolder(MonthAdapter.java:21)
at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:4194)
at com.hornet.dateconverter.DatePicker.DayPickerView.onLayout(DayPickerView.java:139)
at android.view.View.layout(View.java:16054)
at android.view.ViewGroup.layout(ViewGroup.java:5193)
at com.hornet.dateconverter.DatePicker.DayPickerGroup.onLayout(DayPickerGroup.java:129)
at android.view.View.layout(View.java:16054)
at android.view.ViewGroup.layout(ViewGroup.java:5193)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
at android.widget.FrameLayout.onLayout(FrameLayout.java:574)
at android.view.View.layout(View.java:16054)
at android.view.ViewGroup.layout(ViewGroup.java:5193)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
at android.widget.FrameLayout.onLayout(FrameLayout.java:574)
at android.view.View.layout(View.java:16054)
at android.view.ViewGroup.layout(ViewGroup.java:5193)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1990)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1844)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1753)
at android.view.View.layout(View.java:16054)
at android.view.ViewGroup.layout(ViewGroup.java:5193)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1990)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1844)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1753)
at android.view.View.layout(View.java:16054)
at android.view.ViewGroup.layout(ViewGroup.java:5193)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
at android.widget.FrameLayout.onLayout(FrameLayout.java:574)
at android.view.View.layout(View.java:16054)
at android.view.ViewGroup.layout(ViewGroup.java:5193)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
at android.widget.FrameLayout.onLayout(FrameLayout.java:574)
at android.view.View.layout(View.java:16054)
at android.view.ViewGroup.layout(ViewGroup.java:5193)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
at android.widget.FrameLayout.onLayout(FrameLayout.java:574)
at android.view.View.layout(View.java:16054)
at android.view.ViewGroup.layout(ViewGroup.java:5193)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2510)
at android.view.ViewRootImpl.performTraversals(ViewRootI

English

How to add English Calendar

Null pointer exception

java.lang.NullPointerException: Attempt to read from null array
at com.hornet.dateconverter.DateConverter.getFirstWeekDayMonth(DateConverter.java:522)
at com.hornet.dateconverter.DatePicker.MonthView.setMonthParams(MonthView.java:391)
at com.hornet.dateconverter.DatePicker.MonthAdapter$MonthViewHolder.bind(MonthAdapter.java:292)
at com.hornet.dateconverter.DatePicker.MonthAdapter.onBindViewHolder(MonthAdapter.java:222)
at com.hornet.dateconverter.DatePicker.MonthAdapter.onBindViewHolder(MonthAdapter.java:21)
at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:4194)
at com.hornet.dateconverter.DatePicker.DayPickerView.onLayout(DayPickerView.java:139)
at android.view.View.layout(View.java:16992)
at android.view.ViewGroup.layout(ViewGroup.java:5409)
at com.hornet.dateconverter.DatePicker.DayPickerGroup.onLayout(DayPickerGroup.java:129)
at android.view.View.layout(View.java:16992)
at android.view.ViewGroup.layout(ViewGroup.java:5409)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:16992)
at android.view.ViewGroup.layout(ViewGroup.java:5409)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:16992)
at android.view.ViewGroup.layout(ViewGroup.java:5409)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1465)
at android.view.View.layout(View.java:16992)
at android.view.ViewGroup.layout(ViewGroup.java:5409)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1465)
at android.view.View.layout(View.java:16992)
at android.view.ViewGroup.layout(ViewGroup.java:5409)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:16992)
at android.view.ViewGroup.layout(ViewGroup.java:5409)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:16992)
at android.view.ViewGroup.layout(ViewGroup.java:5409)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:16992)
at android.view.ViewGroup.layout(ViewGroup.java:5409)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2483)
at android.view.ViewRootImpl.performTraversals(

Dependency Resolution issue

When adding this library in gradle verion: 7.0.1 It is giving dependency resolution issue:

If I don't use this library the build is successful without any issues

  • What went wrong:
    Execution failed for task ':app:checkDebugDuplicateClasses'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Duplicate class org.intellij.lang.annotations.Flow found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.Identifier found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$FontStyle found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$HorizontalAlignment found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$InputEventMask found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$ListSelectionMode found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$PatternFlags found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TabLayoutPolicy found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TabPlacement found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderJustification found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderTitlePosition found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TreeSelectionMode found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.Language found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.MagicConstant found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.Pattern found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.PrintFormat found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.PrintFormatPattern found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.RegExp found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.Subst found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.jetbrains.annotations.Contract found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.jetbrains.annotations.Nls found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.jetbrains.annotations.Nls$Capitalization found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.jetbrains.annotations.NonNls found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.jetbrains.annotations.NotNull found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.jetbrains.annotations.Nullable found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.jetbrains.annotations.PropertyKey found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)
Duplicate class org.jetbrains.annotations.TestOnly found in modules jetified-annotations-16.0.1 (org.jetbrains:annotations:16.0.1) and jetified-annotations-java5-15.0 (org.jetbrains:annotations-java5:15.0)

 Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
  • Try:

Selected Date is not displayed.

I have selected nepali date from date picker 2078-06-31 (2078-Ashoj 31) but after selected in textfield 2078-07-01 is displayed. In case of converting that date also same ( 2078-07-01) is displayed.

Highlight days in calendar not working

I was trying to show highlight days for all Saturday But it's not working on both my project and sample project present in the library. it is working in date picker dialog but not in the calendar view.

   override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        calendarView = view.findViewById(R.id.calendar)
        calendarView?.setOnDateSetListener(this)
        calendarView?.setHighlightedDays(DateConverter.getAllSaturdays())
    }

The version used: 3.0-beta
OS: Android Q, Pixel 2 API 19 emulator

View issue here:
https://imgur.com/9XAGrc5

When date is november 1 2018 its crash

Fatal Exception: java.lang.NullPointerException
Attempt to read from null array

com.hornet.dateconverter.DateConverter.getFirstWeekDayMonth (DateConverter.java:522)
com.hornet.dateconverter.DatePicker.MonthView.setMonthParams (MonthView.java:391)
com.hornet.dateconverter.DatePicker.MonthAdapter$MonthViewHolder.bind (MonthAdapter.java:292)
com.hornet.dateconverter.DatePicker.MonthAdapter.onBindViewHolder (MonthAdapter.java:222)
com.hornet.dateconverter.DatePicker.MonthAdapter.onBindViewHolder (MonthAdapter.java:21)
android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder (RecyclerView.java:6673)
android.support.v7.widget.RecyclerView.onLayout (RecyclerView.java:4082)
com.hornet.dateconverter.DatePicker.DayPickerView.onLayout (DayPickerView.java:139)
android.view.View.layout (View.java:16672)
android.view.ViewGroup.layout (ViewGroup.java:5440)
com.hornet.dateconverter.DatePicker.DayPickerGroup.onLayout (DayPickerGroup.java:129)
android.view.View.layout (View.java:16672)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:636)

calendar month is not showing properly

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.

Issue in setMaxDate to todayDate(nepali date)

Hello,
When i set max date to today, its shows three days after date also. In this case i have set today date "2079-02-31" but in calendar it limit upto date ashar 3. This issue arised when i had formatted date with "YYYY-MM-DD" -- formatted with date having 2 digit in month and day.
I have clone the project in that also when i disable past dates, its restrict upto ashar 2. Please help for the issue.
dpd.setMaxDate(dateConverter!!.todayNepaliDate)

Thank you

new version crashing 2.1

Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

Always Opening Date picker dialog with current date selected only

I am trying to create a date picker dialog with a default selected date but the following code is opening the calendar always with current date selected.

DatePickerDialog dialog = DatePickerDialog.newInstance(listener, 2077, 4, 15); 
dialog.show();

I have tried passing Model as well but still same issue.

Nepali year only goes until 2000

Hi I was trying this library on a Nursing app we were making for Nurse Association of Nepal, however, the nurses were complaining that the year only goes to 2000, apparently they were profiling a very old person. When they tried using the AD date, the converter failed. Looking at some online date converters the date went below 2000 so I guess that was the issue. Looking at the source code, it seems to be a hard limit that was put in. Would it be possible to lower the min date? I've seen some other converters go to 1970 though i'm not sure how hard that would be to incorporate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.