1.1.53 • Published 3 years ago

@giliweb/datetimerangepicker v1.1.53

Weekly downloads
84
License
ISC
Repository
github
Last release
3 years ago

@giliweb/datetimerangepicker

RWD friendly date+time picker for Vue. Supports date, datetime and time modes, and disabling dates.

The DateTimePicker components are designed to fit all date and time selection, including features of :

  • Drop down Date&Time Picker.
  • Date Range /Single Date selection.
  • Time selection
  • Time display in different format (Reform by vue2-timepicker)

thumb

DateTimePicker.vue

image

Install

$ npm install @giliweb/datetimepicker

or 

$ yarn add @giliweb/datetimepicker

Props and @Event

Basically we initialize the dateTimePicker component by given props, the common use case is to reassign date and time to a data.

And we get the updated value by vue @event @onChange="data=$event".

Props

NameData TypeExampleDescription
startDateDatenew Date()
endDateDateabove
singleDateBooleantrueRange/Single selection, default false

Event

NameData TypeExampleDescription
onChangefunction()=>{}

Usage

<template>
  <date-time-picker
    :startDate = "startDate"          //optional
    :endDate = "endDate"              //optional
    :singleDate = "true"              //optional, default false
    @onChange = "onChange"            //optional
  />
</template>

<script>
import '@giliweb/datetimerangepicker/dist/datetimepicker.css'
import { DateTimePicker } from "@giliweb/datetimerangepicker";

export default {
  name: "app",
  components: {
    DateTimePicker
  },
  methods: {
    onChange: function(data) {
      console.log("data: ", data);
    }
  },
  data: function() {
    return {
      startDate: new Date("2018-12-13T00:03"),
      endDate: new Date("2018-12-16T23:29")
    };
  }
}
</script>

Sub-Components

Selecting Date and Time got so many different scenario, and there is no silver bullet, no such single component fullfill all usecases.

And our solution is decompositing dateTimePicker.vue to four components.

thumb

To See more example, please checkout ./demo/src/App.vue.

import { DateTimePicker } from "@giliweb/datetimerangepicker";
import { DateTimePickerModal } from "@giliweb/datetimerangepicker";
import { DatePicker } from "@giliweb/datetimerangepicker";
import { TimePicker } from "@giliweb/datetimerangepicker";

Remark

The time-picker here is a customized version of the awesome project vue2-timepicker by phoenixwong.

Reference

1.1.52

3 years ago

1.1.53

3 years ago

1.1.49

3 years ago

1.1.48

3 years ago

1.1.51

3 years ago

1.1.50

3 years ago

1.1.47

3 years ago

1.1.46

3 years ago

1.1.45

3 years ago

1.1.44

3 years ago

1.1.43

3 years ago

1.1.42

3 years ago

1.1.41

3 years ago

1.1.40

3 years ago

1.1.37

3 years ago

1.1.36

3 years ago

1.1.34

3 years ago

1.1.35

3 years ago

1.1.33

3 years ago

1.1.32

3 years ago

1.1.31

4 years ago

1.1.29

4 years ago

1.1.28

4 years ago

1.1.30

4 years ago

1.1.27

4 years ago

1.1.26

4 years ago

1.1.25

4 years ago

1.1.24

4 years ago

1.1.23

4 years ago

1.1.22

4 years ago

1.1.21

4 years ago

1.1.19

4 years ago

1.1.20

4 years ago

1.1.18

4 years ago

1.1.17

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.0.9

4 years ago

1.1.7

4 years ago

1.0.8

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago