# uc-calendar

> Calendar UI Component

Latest version **1.0.1** (published 2018-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install uc-calendar
pnpm add uc-calendar
yarn add uc-calendar
bun add uc-calendar
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-10-09 |
| First published | 2018-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 34.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alexey Novikov |
| Maintainers | velocityzen |
| Keywords | unchained, ui, browser, calendar, kiss |

## Links

- npm: https://www.npmjs.com/package/uc-calendar
- Repository: https://github.com/unchainedui/calendar
- Homepage: https://github.com/unchainedui/calendar#readme
- Issues: https://github.com/unchainedui/calendar/issues
- npm.io page: https://npm.io/package/uc-calendar

## Dependencies (3)

- [uc-dom](https://npm.io/package/uc-dom.md) ^1.0.0
- [uc-compose](https://npm.io/package/uc-compose.md) ^1.0.0
- [uc-strings](https://npm.io/package/uc-strings.md) ^1.0.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-10-09
- 1.0.0 — 2018-10-07

## README

# Unchained UI

## Calendar UI Component

[![NPM Version](https://img.shields.io/npm/v/uc-calendar.svg?style=flat-square)](https://www.npmjs.com/package/uc-calendar)
[![NPM Downloads](https://img.shields.io/npm/dt/uc-calendar.svg?style=flat-square)](https://www.npmjs.com/package/uc-calendar)


### Usage

```js
import Calendar from 'uc-calendar';

const elDisplay = get('#display');

const calendar = new Calendar({
  onChange: date => {
    console.log('date', date);
  }
}).appendTo(elDisplay);

```

This component follows **Unchained** UI guidelines.

Constructor options:

* __onChange__ — function, callback will be called when value is changed
* locale – object, locale defenition, default is 'en-US'.
* weekStarts — number, `0` for Sunday or `1` for Monday. Overides the locale settings.
* flip – boolean, default `false`, renders the calendar with the header on the bottom.
* value — integer, timestamp in milliseconds or string, representing a date in a format recognized by the `Date.parse()` method
* mode — string, `days`, `months` or `years`, default `days`. The start display mode.
* forward - string, html string to add to the forward button.
* back - string, html string to add to the back button.

### Methods

#### value([val])

If `val` is undefined returns current value as a Date instance, otherwise sets the value.

#### forward()

Change the calendar page forward

#### back()

Change the calendar page back

#### setMode([mode])

Sets the mode. If mode is `undefined` sets the next mode.

#### toString()

Returns the string representation of the selected date according to locale.

#### remove()

Removes the component.

License MIT

© velocityzen

---
_Source: https://npm.io/package/uc-calendar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
