Code Monkey home page Code Monkey logo

persianrangedatepicker's Introduction

PersianRangeDatePicker

API

Date Picker

Usages:

Use this dependency in your build.gradle file to reference this library in your project

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.ali-sardari:PersianRangeDatePicker:1.3.0'
}

Then in your Java Code, you use it like below.

DatePickerDialog datePickerDialog = new DatePickerDialog(MainActivity.this);
datePickerDialog.setSelectionMode(DateRangeCalendarView.SelectionMode.Range);
//datePickerDialog.setEnableTimePicker(true);
//datePickerDialog.setShowGregorianDate(true);
datePickerDialog.setTextSizeTitle(10.0f);
datePickerDialog.setTextSizeWeek(12.0f);
datePickerDialog.setTextSizeDate(14.0f);
datePickerDialog.setCanceledOnTouchOutside(true);
datePickerDialog.setOnRangeDateSelectedListener(new DatePickerDialog.OnRangeDateSelectedListener() {
        @Override
        public void onRangeDateSelected(PersianCalendar startDate, PersianCalendar endDate) {
            txtStartDate.setText(startDate.getPersianShortDate());
            txtEndDate.setText(endDate.getPersianShortDate());
        }
});

datePickerDialog.showDialog();

persianrangedatepicker's People

Contributors

ali-sardari 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  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

persianrangedatepicker's Issues

استفاده به عنوان Fragment

سلام ممنون بخار این کتابخانه خوبتون
آیا میشه این تقویم رو به صورت فرگمنت و استفاده کرد یعنی به حالت دیالوگ باز نشه و به صورت ثابت روی صفخه باشه و ازش استفاده کرد

Fix deprecated usage

locale in line 98 was deprecated:
locale = mContext.getResources().getConfiguration().locale;
please use this code instead:

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            locale = mContext.getResources().getConfiguration().getLocales().get(0);
        }else {
            locale = mContext.getResources().getConfiguration().locale;
        }

bug in reusability of calendar dialog

if you define the date picker for once and recall it for more than one it will display something not pleasure, you can see that in this picture :see from here

that situation happened while I was trying to use your perfect library like this:

    val myCalendar = DatePickerDialog(this)
    myCalendar.selectionMode = DateRangeCalendarView.SelectionMode.Range
    myCalendar.setCanceledOnTouchOutside(true)
    myCalendar.isDisableDaysAgo = false
    calendar.setOnClickListener {myCalendar.showDialog()}

if I define everything in my on click listener it works correctly!

راستچین شده ماه ها

سلام ممنون بابت کتابخونه خوبتون لطفا اگر مقدور هست ماه ها را راستچین کنید یعنی به چپ تعویض بشن تشکر.

The bug is wrong in counting the months

LibraryV : 1.2.0

Unfortunately, the library has a big bug, there's no bang for the 12th month!
The months start at 0 and end to 11th (March - Esfand).
Also, choosing the historical suffering always chooses the moon one by one.
Please fix this bug.

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.