Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ion2-calendar

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ion2-calendar

ionic2

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-50.18%
Maintainers
1
Weekly downloads
 
Created
Source

ion2-calendar

A configurable and selectable range dates calendar component for ionic2

Usage

install

$ npm install ion2-calendar --save

if you do not use moment

$ npm install moment --save

import module

import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
...
import { CalendarModule } from "ion2-calendar";

@NgModule({
  declarations: [
    MyApp,
    ...
  ],
  imports: [
    IonicModule.forRoot(MyApp),
    CalendarModule
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    ...
  ],
  providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}]
})
export class AppModule {}

Use

import { Component } from '@angular/core';

import {CalendarController} from "ion2-calendar/dist";

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(
    public calendarCtrl: CalendarController
  ) {

  }

  openCalendar(){
    this.calendarCtrl.openCalendar({
      from:new Date()
    })
    .then( res => { console.log(res) } );
  }

}

Demo

date

date

date range

date range

disable weekdays

disable weekdays

weekdays title

weekdays title

month title

month title

days config

days config

API

openCalendar(Options)

Options

NameTypeDefaultDescription
fromDatenew Date()start date
toDate0 (Infinite)end date
titlestring'Calendar'title
isRadiobooleantruetrue for one day ,false for range dates
disableWeekdaysArray[]week to be disabled (0-6)
closeLabelstringcancelcancel button label ,can be an empty string
monthTitlestring'MMM yyyy'month title format
weekdaysTitleArray"Di_Lu_Ma_Me_Je_Ve_Sa".split("_")weeks title
daysConfigArray<DaysConfig>[]days configuration
DaysConfig
NameTypeDefaultDescription
dateDaterequiredconfigured days
markedbooleanfalsehighlight color
disablebooleanfalsedisable
titlestringnonedisplayed title example:'today'
subTitlestringnonesubTitle subTitle example:'christmas'

Output Promise

NameTypeDescription
fromDaystart date If isRadio it is false
toDayend date If isRadio it is false
dateDaydate If isRadio it is true

Day

NameTypeDescription
timenumbertimestamp
markedbooleanhighlight color
disablebooleandisable
titlestringdisplayed title
subTitlestringsubTitle subTitle

Environment

  • Cordova CLI: 6.4.0
  • Ionic Framework Version: 2.0.0-rc.4
  • Ionic CLI Version: 2.1.18
  • Ionic App Lib Version: 2.1.9
  • Ionic App Scripts Version: 0.0.47
  • OS: macOS Sierra
  • Node Version: v6.9.2
  • Xcode version: Xcode 8.2.1 Build version 8C1002

Keywords

FAQs

Package last updated on 02 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc