0.0.32 • Published 3 years ago

calendar-native-web-component v0.0.32

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Simple native web component calendar

Native HTML web component calendar. Can easily be used in any framework or plain HTML.

calendar explained

Styled Examples (Codepen)

Material Design

Simple Design

Mobile Design

Dark Design

With Input

Integration

Install the calendar component

npm i calendar-native-web-component

or

yarn add calendar-native-web-component

Import the package

import 'calendar-native-web-component'

or

require('calendar-native-web-component')

Use Tag

Just integrate this Tag into your HTML and you should see the component.

<date-picker></date-picker>

Properties

Example of setters

Usage in HTML file

<date-picker
        id="date-picker"
        primary-color="#000"
        secondary-color="#999"
        header-text-color="#000"
        disabled-text-color="#eee"
        day-text-color="#333"
        selected-text-color="#fff"
        selected-border-color="blue"
        month-name-background="#E9B947"
        day-names-background="#01123F"
        disable-days-before-today="true"
        day-names="Mo, Di, Mi, Do, Fr, Sa, So"
        month-names="January, February, March, April, May, June, July, August, September, October, November, December"
        show-fill-days="false"></date-picker>

Usage in JavaScript

const datePicker = document.getElementById('date-picker')
datePicker.dayNames = ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So']
datePicker.monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
datePicker.showFillDays = false
datePicker.disableDaysBeforeToday = true
datePicker.disabledDates = [
    {year: 2021, day: 3, month: 9},
    {year: 2021, day: 12, month: 9},
    {year: 2021, day: 22, month: 9},
]
datePicker.primaryColor = '#000'
datePicker.secondaryColor = '#000'
datePicker.headerTextColor = '#000'
datePicker.disabledTextColor = '#000'
datePicker.dayTextColor = '#000'
datePicker.selectedTextColor = '#000'
datePicker.selectedBorderColor = '#000'
datePicker.monthNameBackground = '#E9B947'
datePicker.dayNamesBackground = '#01123F'
datePicker.additionalStyle = `
    .calendar > * {
      line-height: 2rem;
    }
    
    header {
        padding: .5rem 1rem;
    }
`

Example of getters

Usage in HTML file

<date-picker
        id="date-picker"
        current-month="8"
        today="24.8.2021"
        selected-date="28.8.2021"></date-picker>

Usage in JavaScript

const datePicker = document.getElementById('date-picker')
console.log(datePicker.selectedDate)
console.log(datePicker.currentMonth)
console.log(datePicker.today)

Dev Setup

  • clone repository
  • open the console and switch into the root of this repository
  • run yarn to install the dependencies

Run dev server

yarn start

Open http://localhost:8081/ in your browser and start building.

Build for production use

yarn run build

0.0.32

3 years ago

0.0.31

3 years ago

0.0.30

3 years ago

0.0.29

3 years ago

0.0.28

3 years ago

0.0.27

3 years ago

0.0.26

3 years ago

0.0.25

3 years ago

0.0.24

3 years ago

0.0.23

3 years ago

0.0.22

3 years ago

0.0.21

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago