# vue-fast-datetime

> A quick select datetime picker component for vue.js

Latest version **1.0.3-beta.11** (published 2018-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-fast-datetime
pnpm add vue-fast-datetime
yarn add vue-fast-datetime
bun add vue-fast-datetime
```

## 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.3-beta.11 |
| Published | 2018-05-15 |
| First published | 2018-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 148.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Ethan Wong |
| Maintainers | zeethan |
| Keywords | vue, datetime, components |

## Links

- npm: https://www.npmjs.com/package/vue-fast-datetime
- Repository: https://github.com/zeethan/vue-fast-datetime
- Homepage: https://github.com/zeethan/vue-fast-datetime#readme
- Issues: https://github.com/zeethan/vue-fast-datetime/issues
- npm.io page: https://npm.io/package/vue-fast-datetime

## Dependencies (1)

- [vue](https://npm.io/package/vue.md) ^2.5.2

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.3-beta.11 (latest) — 2018-05-15
- 1.0.3-beta.10 — 2018-05-15
- 1.0.3-beta.9 — 2018-05-14
- 1.0.3-beta.8 — 2018-05-14
- 1.0.3-beta.7 — 2018-05-14
- 1.0.3-beta.6 — 2018-05-14
- 1.0.3-beta.5 — 2018-05-14
- 1.0.3-beta.4 — 2018-05-14
- 1.0.3-beta.3 — 2018-05-13
- 1.0.3-beta.2 — 2018-05-13
- 1.0.3-beta.1 — 2018-05-12
- 1.0.3 — 2018-05-05
- 1.0.2 — 2018-05-05
- 1.0.1 — 2018-05-04
- 1.0.0 — 2018-05-04

## README

# vue-fast-datetime
A quick select datetime picker component for vue.js

## DEMO HERE
**[Go to demo](http://zeethan.github.io/)**.

![Screen record](https://zeethan.github.io/assets/images/vue-fastdatetime-screenshot.gif)

## Install
```shell
npm i vue-fast-datetime -D
```

## Usage
#### As global component
```main.js
  import FastDatetime from 'vue-fast-datetime'
  import 'vue-fast-datetime/dist/vue-fast-datetime.min.css'
  Vue.use(FastDatetime)
```
This will register a global component `<fast-datetime>`

```
  <fast-datetime
    position="start"
    :startDate=startDate
    :endDate=endDate
    :startValue=dateValueStart
    :endValue=dateValueEnd>
  </fast-datetime>
```

#### As plugin
```js
  import FastDatetime from 'vue-fast-datetime'
  import 'vue-fast-datetime/dist/vue-fast-datetime.min.css'
  Vue.use(FastDatetime)
```
This will register a plugin `this.$FastDateTime.show`

```
 this.$FastDateTime.show({
  position:'start',
  startDate: this.startDate,
  endDate: this.endDate,
  startValue: this.dateValueStart,
  endValue:this.dateValueEnd
})
```

## Available props
The component accepts these props:

| Attribute        | Type                                            | Default              | Description      |
| :--------------- | :---------------------------------------------- | :------------------- | :----------------|
| position         | String											 | `start`              | Initial the first choose time whether starttime or endtime  |
| startDate        | Object Date                                     | -                    | The starttime of fase-datetime (required)                   |
| endDate          | Object Date                                     | -                    | The endtime of fase-datetime (required)                     |
| startValue       | String                                          | -                    | Current value of starttime,this value must be less than the starttime (required)                   |
| endValue         | String                                          | -                    | Current value of endtime,this value must be less than the starttime (required)                   |
| confirmText      | String                                          | `ok`                 | The text of confirm button                   |
| cancelText       | String                                          | `cancel`             | The text of cancel button                 |
| hourRow          | String                                          | `{value}`            | Template of hourRow                 |
| minuteRow        | String                                          | `{value}`            | Template of minuteRow                 |

## methods

| name                       | type               | Default              | Description      |
| :------------------------- | :----------------- | :------------------- | :----------------|
| `onSelect` / `@on-change`  | `Function`         | (type, value, wholeValue) => {} | CallBack after date scroller value changed, pass three arguments, current scroller type `type` and current scroller value `value` and datetime value `wholeValue` |
| `onConfirm`                | `Function`         | (startValue, endValue) | CallBack after click confirm button,set current startValue and endValue |
| `onShow` / `@on-show`      | `Function`         | :---:                | show the vue-fast-datetime |
| `onHide` / `@on-hide`      | `Function`         | :---:                | hide the vue-fast-datetime |

## CHANGELOG
#### 1.0.3-beta.10
- fix some bugs
#### 1.0.0
- Initial release

## License
 MIT

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