npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nerd305/vuetify-date-range-picker

v3.1.3

Published

Vuetify Date Range Picker with compare period and presets, optimized for best mobile and desktop user experience

Downloads

439

Readme

Vuetify Date Range Picker

Date Range Picker component build with Vuetify, optimized for best mobile and desktop user experience.

Install

npm install @nerd305/vuetify-date-range-picker
import DateRangePicker from '@nerd305/vuetify-date-range-picker'

export default {
  // ...
  components: {
    DateRangePicker
  }
  // ...
}

Usage

<date-range-picker :namespace="datePickerStores" :config="configuration" @change="setDateRange" />

example configuration using last 30 days preset and compare to previous period:

<script>
  import { datePickerStores } from '@nerd305/vuetify-date-range-picker'
  import { presets } from '@nerd305/vuetify-date-range-picker'

  const configuration = {
    dark: false,
    compare: true,
    dateFormat: 'MMM Do, YYYY',
    dateStart: presets.LAST_30_DAYS[0],
    dateUntil: presets.LAST_30_DAYS[1],
    compareStart: presets.PREVIOUS_PERIOD[LAST_30_DAYS][0],
    compareUntil: presets.PREVIOUS_PERIOD[LAST_30_DAYS][1],
    primaryPreset: LAST_30_DAYS,
    comparePreset: PREVIOUS_PERIOD
  }

</script>

Available props

| Prop | Type | Default | Description | | ----------- | ------ | ------------- | ---------------------------------------------- | | config | Object | configuration | Date format of the DateRangePicker | | namespace | String | none | DateRangePicker Pinia Store | | storeNames | Array | none | Array of Date formats for the DateRangePicker |

| Object property | Type | Default | Description | | --------------- | ------- | --------------- | ------------------------------------------------------------------------ | | dark | Boolean | false | dark theme for DateRangePicker | | compare | Boolean | false | turn on/off comare period | | dateFormat | String | MM-DD-YYYY | Date format of the DateRangePicker | | dateStart | STRING | DAYS_AGO_7 | 7 days ago | | dateUntil | STRING | TODAY | today | | compareStart | STRING | DAYS_AGO_15 | 7 prior days from dateStart | | compareUntil | STRING | DAYS_AGO_8 | 7 prior days from dateuntil | | primaryPreset | STRING | LAST_WEEK | constant name representing last week | | comparePreset | STRING | PREVIOUS_PERIOD | constant name representing previous 7 days from primary preset selection |

Events

These events are emitted on actions in the datepicker

| Event | Output | Description | | ------ | ------- | ----------------------------------------------------------------------------------------------------------------------- | | change | Object | Date Range Picker date range selections, selected preset, comparison period, as described in above configuration object | | opened | Boolean | emits true if the component is engaged and false when not |

Date formatting

String formatter

Should be parsing and using date string format as in moment package.

| Token | Desc | Example | | ----- | ---------------------- | ----------- | | d | day | 1 | | dd | 0 prefixed day | 01 | | D | abbr day | Mon | | su | date suffix | st, nd, rd | | M | month number (1 based) | 1 (for Jan) | | MM | 0 prefixed month | 01 | | MMM | abbreviated month name | Jan | | MMMM | month name | January | | yy | two digit year | 16 | | yyyy | four digit year | 2016 |

Presets

Static presets

Used for primary date range selection

  • LAST_WEEK
  • LAST_MONTH
  • LAST_7_DAYS
  • LAST_30_DAYS

Computed presets

Used for compare date range selection based on primary date range selection

  • PREVIOUS_PERIOD
  • PREVIOUS_YEAR