Coder Social home page Coder Social logo

huukuntp1 / nativescript-ngx-date-range Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dudipsh/nativescript-ngx-date-range

0.0 0.0 0.0 3.83 MB

DateRange Calendar for Nativescript

License: Apache License 2.0

CSS 1.49% TypeScript 31.31% HTML 1.30% JavaScript 63.04% Shell 2.63% Ruby 0.22%

nativescript-ngx-date-range's Introduction

Nativescript Date Range

Date Range Picker plugin for Nativescript Support RTL nativesceipt date range nativesceipt date range

Installation

npm i nativescript-ngx-date-range --save

Usage

app.module

export class HomeComponent implements OnInit {
    dateRange;
    constructor() {
    }

    ngOnInit(): void {
        const options = new Options();
        options.selectionMode = 'RANGE';
        options.selectToday = true;
        options.disablePrevDates = true;
        this.dateRange =  create(options);
     }
    selectedDates() {
        console.log(this.dateRange.getSelectedDates())
    }

}

home.component.html

<StackLayout>
    <Button class="btn btn-active" text="Console Dates" (tap)="selectedDates()"></Button>
    <NgxDateRange></NgxDateRange>
</StackLayout>

API

getSelectedDates() => {
    startDate: string,
    endDate: string,
    originDates: string[]
}

Options  = {
    selectionMode?: 'SINGLE' | 'MULTIPLE' | 'RANGE'; // default = RANGE
    initialDate?: 'yyyy/mm/dd' // default = today
    simpleDateFormat?: string; // default = "MMMM, YYYY"
    supportsRtl?: boolean; // default = false
    disablePrevDates?: boolean; // default = false
    selectToday?: boolean;  // default = false
    minDate?: string; // (Android only) default = today
    maxDate?: string; // (Android only) default = today + 1 year
    language?: 
        {
             countryCode: 'ISR', //default = null
             languageCode: 'heb' // default = null
         };

}

Colors

colors.xml

projectName/App_Resources/Android/src/main/res/values/colors.xml
    <color name="calendar_selected_day_bg">#a6d3d6</color>
    <color name="calendar_selected_range_bg">#a6d3d6</color>
    <color name="calendar_unavailable_bg">#585757</color>
    <color name="calendar_range_middle_unavailable_bg">#eae72b</color>
    <color name="calendar_range_middle_deactivated_bg">#673AB7</color>

Language object

License

Apache License Version 2.0

nativescript-ngx-date-range's People

Contributors

dudipsh avatar inocentumabhijit avatar shahdeep1989 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.