1.3.0 • Published 7 years ago

mob-date-selector v1.3.0

Weekly downloads
17
License
MIT
Repository
-
Last release
7 years ago

Intro

  • User-defined units. You can set year and month or month, date, hour and minute.
  • User-defined time ranges. You can set anytime with the precision of a minute
  • For example, you can set begin time at Dec -27(th), 2011 102:12 and end time at Oct 21(st), 2020 20:20

1. How to use

npm i mob-date-selector --save-dev

2. How to import

webpack.config.js:

var path = require('path');
module.exports = {
entry : {...},
output : {...},
module : {
	loaders :[{
		test: /\.css$/,
		loader: 'style!css'
	}, {
		test: /\.js$/,
		exclude: path.resolve('./node_modules'),
		loader: 'babel',
	}]
}
}

html:

<body>
	<!-- the #date-selector-input can be any other dom for your convenient-->
	<input id="date-selector-input" type="text" readonly/>
	<!-- the #targetContainer must be the outermost dom below body -->
	<div id="targetContainer"></div>
</body>

js:

import DateSelector from 'mob-date-selector';
new DateSelector({ ... });

Parameter List:

AttributesTypeValueDetails
input{String}eg:'date-selector-input'the id of the dom you touch.
container{String}eg:'targetContainers'the id of the container you ready to append dom.
type{Number}0 OR 10:free style without tab; 1: fixed style with tab.
param{Array}eg:0, 1, 1, 1, 1user-defined units, every position means 'year', 'month', 'day', 'hour', 'minute'. 1 means you need the unit,0 means you dont need it. There must be serial 1.
beginTime{Array}eg:3,27,12,12 Mar 27(th) 12:12 default : 1970, 1, 1, 0, 0user-defined begin time points. An empty array means default array. The equivalent of every position is the sequent position of 1 in param.
endTime{Array}the same to beginTime default : nextYear, 12, 31, 23, 59user-defined end time points. An empty array means default array. The equivalent of every position is the sequent position of 1 in param.
recentTime{Array}the same to beginTimeuser-defined recent time points. An empty array means NOW. The equivalent of every position is the sequent position of 1 in param.
success{function}function(arr){alert(arr)}function(arr){} User-defined callback. The first param is the result.

3. Tips

  • For questions and issues please use THIS WAY
  • You must instantiate it after ready.
  • I am Appian.
1.3.0

7 years ago

1.2.7

7 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.10

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago