All Projects → Fi2zz → TypePicker

Fi2zz / TypePicker

Licence: MIT license
A date picker use in web and react-native

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to TypePicker

Bunny
BunnyJS - Lightweight native (vanilla) JavaScript (JS) and ECMAScript 6 (ES6) browser library, package of small stand-alone components without dependencies: FormData, upload, image preview, HTML5 validation, Autocomplete, Dropdown, Calendar, Datepicker, Ajax, Datatable, Pagination, URL, Template engine, Element positioning, smooth scrolling, routing, inversion of control and more. Simple syntax and architecture. Next generation jQuery and front-end framework. Documentation and examples available.
Stars: ✭ 473 (+3278.57%)
Mutual labels:  datepicker, vanilla-js
vue-persian-datepicker
A datepicker component for select Persian date
Stars: ✭ 23 (+64.29%)
Mutual labels:  datepicker, vue-datepicker
vue3-date-time-picker
Datepicker component for Vue 3
Stars: ✭ 157 (+1021.43%)
Mutual labels:  datepicker, vue-datepicker
Core Components
Accessible and lightweight Javascript components
Stars: ✭ 85 (+507.14%)
Mutual labels:  datepicker, vanilla-js
yii2-datetime-widgets
Datetime widgets for Yii2
Stars: ✭ 22 (+57.14%)
Mutual labels:  datepicker
jquery-datepicker
A full-featured datepicker jquery plugin
Stars: ✭ 35 (+150%)
Mutual labels:  datepicker
persian-mobile-datepicker
Modern React Persian Mobile Date and Time picker
Stars: ✭ 93 (+564.29%)
Mutual labels:  datepicker
eslint-config-yara
Yara Digital Labs JavaScript Style Guide
Stars: ✭ 12 (-14.29%)
Mutual labels:  vanilla-js
vue-date-range-picker
A vue component using Bootstrap 4 styles for date range selection
Stars: ✭ 30 (+114.29%)
Mutual labels:  datepicker
flex-splitter-directive
Dead simple panes splitter control based on flexbox. JS + CSS < 1kB (gzipped) with no dependencies.
Stars: ✭ 19 (+35.71%)
Mutual labels:  vanilla-js
lego
🚀 Web-components made lightweight & Future-Proof.
Stars: ✭ 69 (+392.86%)
Mutual labels:  vanilla-js
rn-date-range
date picker component for react native
Stars: ✭ 16 (+14.29%)
Mutual labels:  datepicker
mm-components
Music Markups components
Stars: ✭ 50 (+257.14%)
Mutual labels:  vanilla-js
scrolly.js
Scrolly: fast vanilla JS scrollbar plugin with React.js Component & jQuery/Zepto/jBone plugin.
Stars: ✭ 18 (+28.57%)
Mutual labels:  vanilla-js
datePicker
时间选择器,包含年月、年月日、年月日时分秒、
Stars: ✭ 14 (+0%)
Mutual labels:  datepicker
event-driven-web-components-realworld-example-app
Exemplary real world application built with Vanilla JS Web Components in an Event Driven Architecture
Stars: ✭ 55 (+292.86%)
Mutual labels:  vanilla-js
silverware-calendar
SilverWare Calendar Module
Stars: ✭ 15 (+7.14%)
Mutual labels:  datepicker
handy-collapse
A pure Javascript module for accordion/collapse UI without jQuery
Stars: ✭ 23 (+64.29%)
Mutual labels:  vanilla-js
datepicker
A simple datepicker with Chakra-UI and date-fns
Stars: ✭ 140 (+900%)
Mutual labels:  datepicker
paginas-acessiveis
Exemplo de páginas HTML acessíveis, construídas em HTML, CSS e JS puro, demostrando vários componentes interativos construídos de forma inclusiva.
Stars: ✭ 63 (+350%)
Mutual labels:  vanilla-js

TypePicker

A date picker use in web and react-native

INSTALL

	npm install typepicker
	or
	yarn add typepicker

OPTIONS

OPTION REQUIRED TYPE DESC Default
size NO number Size of data created 1
selection NO number Size of data picked 1

API

	apply.select(date:Date)=>void

	apply.date(date:Date)=>void

	apply.dates(dates:Date[])=>void

	apply.update()=>void;

	apply.disableDate((date:Date)=>boolean)

	listen(({type,types,payload})=>void)

EXAMPLE

Full Example

	//if you are using typescript
	import TypePicker from "typepicker";

	const config = {
		size:1,
		selection:1
	}

	interface TypePickerDate {
	  date: Date;
	  invalid: boolean;
	  disabled: boolean;
	  status?: {
	    isActive?: boolean;
	    isStart?: boolean;
	    isEnd?: Boolean;
	    inRange?: Boolean;
	  };
	}


	const typepicker= new TypePicker(config);

	const onSelectDate =(date:Date[])=>{

		// to disaplay selected values
	}
	const onDataUpdate =(data:[])=>{

			const renderData =data.map(item=>{
						return  {
							year: <number>item.year
							month: <number> item.month,
							dates: <TypePickerDate>item.dates						}
			})
		//here goes how your datepicker ui render
		//example
		//document.getElementById('picker') .innerHTML=template(renderData)



	}

	//setup listeners of select date and data update;
	typepicker.listen(({type,payload})=>[
				if(type==='select'){onSelectDate(payload)}
				if(type==='update'){onDataUpdate(payload)}
	})


	// jump to some date
	// typically use in switching ui display

	typePicker.apply.date(new Date(2019,7,1))

	//set initial dates , its length should euqal to `config.selection`,
	//do not care about the order, we sort them inside picker
	typepicker.apply.dates([someDateObject1,...res])

	//set disabled date
	typepicker.apply.disableDate(date=>{
			return date.getDate() ===31 || date.getDay()===4 //...more conditions
	})

	//call TypePicker update method to trigger rerender
	typepicker.apply.update()

	//select some date from picker data
	//it will trigger `typepicker.listen`
	typepicker.apply.select(someDateObject)






Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].