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

@farris/ui-datepicker

v1.1.3

Published

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.2.0.

Downloads

49

Readme

Datepicker

This library was generated with Angular CLI version 7.2.0.

使用实例

html

<farris-datepicker
    [(ngModel)]="singleDate"
    [disabled]="opts.disabled"
    [readonly]="opts.readonly"
    [editable]="opts.editable"
    [locale]="opts.locale"
    [dateRange]="opts.dateRange"
    [showTime]="opts.showTime"
    [showType]="opts.showType"
    [dateFormat]="opts.dateFormat"
    [placeholder]="opts.placeholder"
    [maxDate]="opts.maxDate"
    [minDate]="opts.minDate"
    [dateRangeDatesDelimiter]="opts.dateRangeDatesDelimiter"
    [shortcuts]="opts.shortcuts"
></farris-datepicker>

配置项

Input

disabled

  • default: false
  • type: boolean

是否禁用该组件。

readonly

  • Default:false
  • type: boolean

是否只读。

editable

  • Default:true
  • type: boolean

是否只能选择数据,不可键入。

dateRange

  • Default:false
  • type: boolean

是否使用日期范围输入模式。

showTime

  • Default:false
  • type: boolean

是否使用时间输入框。

showType

  • Default:1
  • type: number
  • options: 'all': 1 | 'noDate': 2 | 'noDateAndMonth': 3 | 'selectWeek': 4

显示类型,默认显示全部;不显示日期,用于选择年月模式;不显示日期及月份,用于选择年模式;selectWeek 用于周选择。

locale

  • default: zh-cn
  • type: string
  • options: 'en' | 'ja' ...

本地化。

dateFormat

  • Default:yyyy-mm-dd
  • type: string

日期格式化,zh-cn 模式下默认为 yyyy-mm-dd

placeholder

  • Default:请选择
  • type: string

为空时显示的占位符。

maxDate

  • Default:{year: 9999,month: 12,day: 31 }
  • type: object

最大日期。

minDate

  • Default:{year: 1840,month: 1,day: 1 }
  • type: object

最小日期。

disableDateRangesBegin

  • Default:{year: 0,month: 0,day: 0}
  • type: object

禁用日期开始时间。

disableDateRangesEnd

  • Default:{year: 0,month: 0,day: 0}
  • type: object

禁用日期结束时间。

disableDates

  • Default:[]
  • type: array<object>

禁用的日期,例如[{year: 2019,month: 1,day: 1 },{year: 2019,month: 1,day: 2 } ]。

showWeekNumbers

  • Default:false
  • type: boolean

是否显示第几周。

dateRangeDatesDelimiter

  • Default:~
  • type: string

日期范围模式下 input 的显示分割符合。

shortcuts

  • Default:[]
  • type: array<object>

配置左侧 sidebar 快捷键。

示例:

;[
    {
        text: '今天',
        onClick(setTime) {
            setTime.emit(new Date())
        }
    },
    {
        text: '昨天到今天',
        onClick(setTime) {
            setTime.emit({
                begin: new Date(new Date().getTime() - 3600 * 1000 * 24),
                end: new Date()
            })
        }
    },
    {
        text: '一周前',
        onClick(setTime) {
            setTime.emit(new Date(new Date().getTime() - 3600 * 1000 * 24 * 7))
        }
    }
]

output

clear

清空内容时触发。

valueChanged

当内容改变触发。

onBlur

当 input 失去焦点触发。