Giter Site home page Giter Site logo

aagitoex / compose-nepcal Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 281 KB

Nepali date picker and converter library for compose ui android.

License: MIT License

Kotlin 100.00%
converter date datepicker nepali picker android compose dateconverter kotlin calendar

compose-nepcal's Introduction

compose-nepcal (Nepali date picker and converter for compose)

Current version 1.0.0-beta02

This is a android compose-ui date picker library for nepali (BS) calendar.

Requirements

  1. Compose 1.2.0+ (kotlin 1.7.0+)
  2. Compose Material 1.1.1
  3. Java8 Date Time Api's (available through coreLibraryDesugaring)

Step 1: Enable coreLibraryDesugaring

Before getting started, make sure coreLibraryDesugaring is enabled as this library depends on java8 LocalDateTime. Learn
more about desugaring at developer.android.com.

compileOptions {  
    coreLibraryDesugaringEnabled true
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}  

kotlinOptions {  
    jvmTarget = "1.8"
}  

dependencies {  
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}  

Step 2: Add dependency compose 1.1.1

Please also note the library leverages Compose MaterialTheme for styling. To get started include
following maven dependency in your app gradle file.

implementation 'io.github.aagitoex:compose-nepcal:0.0.1-alpha01'  

Step 2: Add dependency compose 1.2.0+

implementation 'io.github.aagitoex:compose-nepcal:1.0.0-beta02'  

Step 3: Display date picker dialog

The library provides a date picker dialog api that is similar to Dialog in compose.

Surface() {  
    var showDateDialog by remember {
        mutableStateOf(false) 
    }    
    if (showDateDialog) {
        CalendarDialog(
            selectedDate = LocalDate.now()!!,
            onDismissRequest = { showDateDialog = false },
            onDateChange = {
                    localDate: LocalDate ->
            }  
        )
    }
}  

This project uses nepdate java lib and so all date conversion
functions are available for you to use. Head over to the link for the date converter API docs.

Sample Screenshots

Month View Year View

compose-nepcal's People

Contributors

aagitoex avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.