@tiny-components/datepicker (0.4.0)

Published 2 weeks ago by HerrHase

Installation

@tiny-components:registry=https://git.node001.net/api/packages/tiny-components/npm/
npm install @tiny-components/datepicker@0.4.0
"@tiny-components/datepicker": "0.4.0"

About this package

Tiny Components - datepicker

Datepicker for show Month and select a Single day.

Created with Riot.js

Using Styles for UI from Plain-UI, Date will be handle by Day.js and Events with Observable

Source: https://gitea.node001.net/tiny-components/datepicker
Mirror: https://github.com/node001-net/tiny-components-datepicker

demo

Installation

Setup this registry in your project .npmrc file:

@tiny-components:registry=https://gitea.node001.net/api/packages/tiny-components/npm/

Install with npm or yarn

npm i --save @tiny-components/datepicker
yarn add @tiny-components/datepicker

Using

const dispatcher = observable()

riot.register('tiny-datepicker', Datepicker)
riot.mount('tiny-datepicker', {
    'dispatcher': dispatcher
})
<tiny-datepicker></tiny-datepicker>

For starting weeks on Sunday,

<tiny-datepicker iso-week="0"></tiny-datepicker>

For setting date on start,

<tiny-datepicker date="2015-12-10"></tiny-datepicker>

Events

If Date will "change",

dispatcher.on('change', (data) => {
    console.log(data.date.format('YYYY-MM-DD'))
})

Send Datepicker a new Date,

dispatcher.trigger('update', {
    date: '2012-10-20'
})

i18n

Names of Days and Months will be used from Day.js, here is a list of supported languages.
Change language is only possible if you add change locale globally.

import de from 'dayjs/locale/de'
dayjs.locale('de')

Dependencies

Dependencies

ID Version
@riotjs/observable ^4.1.1
@tiny-components/plain-ui ^0.6.0
dayjs ^1.11.19
hammerjs ^2.0.8
riot ^10.1.2

Development Dependencies

ID Version
@riotjs/webpack-loader ^6.0.0
@tiny-components/webpack ^0.6.0
Details
npm
2 weeks ago
1
Björn Hase
MIT
latest
603 KiB
Assets (1)
Versions (7) View all
0.4.0 on 2025-12-17
0.3.2 on 2025-03-11
0.3.1 on 2025-03-05
0.3.0 on 2025-03-05
0.2.1 on 2025-03-05