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

fdatepicker-json.js

v1.0.1

Published

支持后台渲染后台数据的移动端满屏日历插件,支持单个月份切换和多个月份平铺展示两种方式。使用多月份平铺展示时,支持初始化加载个数、分页加载。

Downloads

2

Readme

fDatepicker-Json.js

持后台渲染后台数据的移动端满屏日历插件,支持单个月份切换和多个月份平铺展示两种方式。使用多月份平铺展示时,支持初始化加载个数、分页加载。 目前供需要展示价格、库存的业务线使用。

Initialize

// data
var json = [{
	"date": "2015-08-09",
	"currency": "$",
	"price": "1923",
	"quota": 0
}, {
	"date": "2015-08-12",
	"currency": "$",
	"price": "1923",
	"quota": 10
}, {
	"date": "2015-08-16",
	"currency": "$",
	"price": "1923",
	"quota": 2
}, {
	"date": "2015-08-23",
	"currency": "$",
	"price": "1923",
	"quota": 0
}, {
	"date": "2015-08-26",
	"currency": "$",
	"price": "1923",
	"quota": 0
}, {
	"date": "2015-08-30",
	"currency": "$",
	"price": "1923",
	"quota": 0
}, {
	"date": "2015-09-03",
	"currency": "$",
	"price": "1923",
	"quota": 0
}];


// single frame
var datepicker = new Datepicker({
    container: '#container',
    initDate: new Date('2015/8/21'),
    startDate: new Date('2015/8/3'),
    endDate: new Date('2016/8/3'),
    singleFrame: true,
    dateJson: json,
    selectCallback: function(date) {
        $('#dateTips').html(date);
    }
});


// multiple frames
var datepicker = new Datepicker({
    container: '#container',
    initDate: new Date('2015/8/21'),
    startDate: new Date('2015/8/3'),
    endDate: new Date('2016/8/3'),
    initFrame: 4,
    loadFrames: 3,
    loadOffset: 60,
    dateJson: json,
    selectCallback: function(date) {
        $('#dateTips').html(date);
    }
});

Demo

link:http://frender.github.io/fDatepicker-Json.js

Options

  • container @String

需要制定的展示日历的根元素

  • initDate @String or @Date

初始化的选中日期。如果使用@String类型,请遵循标准的YYYYMMDD模式,否则实现标准Date.parse的浏览器会报invalid date错误。下同。

  • startDate @String or @Date

日历的开始日期

  • endDate @String or @Date

日历的结束日期

  • singleFrame @Boolean

使用单个月份模式,支持月份切换

  • initFrames @Number

【多月份模式】初始化的个数

  • loadFrames @Number

【多月份模式】分页加载每页的个数

  • loadOffset @Number

【多月份模式】动态加载的偏移量

  • i18n @Boolean

开启国际化支持英文模式,默认使用中文模式

  • dateJson @Object

渲染价格日历需要的数据

  • selectCallback @Function

选择日期后的回调函数

Installation


bower install fDatepicker-Json.js [--save[-dev]]

or


npm install fdatepicker-json.js [--save[-dev]]

Version

  • 1.0.0