Giter Club home page Giter Club logo

calendar's Introduction

微信小程序「极点日历」插件

「极点日历」插件支持 1900 年 1 月 ~ 2099 年 12 月这两百年间的公历和农历显示,插件提供了丰富的可配置属性,包括日期的显示方式、选择范围、是否显示农历等,可自定义来适配不同的使用场景。

插件ID:wx92c68dae5a8bb046

版本历史:

v1.0.0 完成插件基本功能

v1.1.0 修复日期点击bug

v1.1.1 修复结束日期bug

v1.1.2 修复日期显示不对齐的问题,修复农历计算中偶发性bug

v1.1.3 修复日历1月和12月点击上一年日期和下一年日期年份返回错误的bug

具体的使用方法,可以参考下面的接口文档和用法例子

1、添加插件到自己的小程序

2、日历属性接口文档

3、日历事件用法

4、自定义日历样式

插件使用效果演示

Demo1

Demo1

Demo2

Demo2

Demo3

Demo3

Demo4

Demo4

Demo5

Demo5

Demo6

Demo6

Demo7

Demo7

calendar's People

Contributors

czcaiwj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calendar's Issues

极点日历错误

点击日历具体某一天的事件,“lunarDay“和“lunarMonth”的值一样

插件未授权使用,Component is not found in path

jsEnginScriptError
Component is not found in path "plugin://wx92c68dae5a8bb046/calendar" (using by "pages/index/index")
Error: Component is not found in path "plugin://wx92c68dae5a8bb046/calendar" (using by "pages/index/index")

add plugin error

你好:
按照文档的步骤 添加页面的.json配置后报错 帮忙看下 Thanks

jsEnginScriptError
Component is not found in path "pages/about/plugin:/calendar/calendar" (using by "pages/about/about")
Error: Component is not found in path "pages/about/plugin:/calendar/calendar" (using by "pages/about/about")
at e (http://127.0.0.1:51225/appservice/__dev__/WAService.js:12:8473)
at e (http://127.0.0.1:51225/appservice/__dev__/WAService.js:12:8625)
at F (http://127.0.0.1:51225/appservice/__dev__/WAService.js:12:14589)
at Object.t.addView (http://127.0.0.1:51225/appservice/__dev__/WAService.js:12:15599)
at Function.value (http://127.0.0.1:51225/appservice/__dev__/WAService.js:14:6004)
at I (http://127.0.0.1:51225/appservice/__dev__/WAService.js:13:17130)
at L (http://127.0.0.1:51225/appservice/__dev__/WAService.js:13:19036)
at U (http://127.0.0.1:51225/appservice/__dev__/WAService.js:13:19590)
at Function. (http://127.0.0.1:51225/appservice/__dev__/WAService.js:13:21986)
at http://127.0.0.1:51225/appservice/__dev__/WAService.js:13:27020

日历的事件,失效了,点击没反应了

<view class="calendar" style="margin-top: 10px;padding: 10px;">
        <calendar active-type="square" binddatechange="dateChange" binddayclick="dayClick" bindnextmonth="next" bindprevmonth="prev" board-style="demo4-board board" calendar-style="demo4-calendar {{calendarshow?'calendarshow':''}}" cell-size="30" days-color="{{dayscolor}}" header-style="demo4-header" show-more-days="{{true}}" weeks-type="cn">
        </calendar>
        <view bindtap="showcanlendar" class="" style="text-align: center;color: #939393;margin-top: 15px;">
            下拉查看更多
        </view>
    </view>
dayClick: function (event) {
      console.log(event.detail);
      console.log('event.detail');
  },

绑定的事件点击都没反应

end-date和start-date属性赋值错误

我是绑定在一个时间字符串上了,值的格式也没错为 ‘2018-08’ 这种的,但控制台会报错”结束日期必须是YYYY-MM格式;“,但如果我不通过{{}}绑定,直接写死一个start-date="2018-08"就不会报错,这是为什么。

日期选择器里选择2020年5月时抛出异常,其他日期暂未发现。

VM1614:1 thirdScriptError monCyl is not defined; [Component] Event Handler Error @ plugin-private://wx92c68dae5a8bb046/components/calendar/calendar#dateChange ReferenceError: monCyl is not defined at Object.solarToLunar (http://127.0.0.1:54459/appservice/__onlineplugin__/wx92c68dae5a8bb046/1.1.0/appservice.js:982:3761) at r._setCalendarData (http://127.0.0.1:54459/appservice/__onlineplugin__/wx92c68dae5a8bb046/1.1.0/appservice.js:985:4549) at r.dateChange (http://127.0.0.1:54459/appservice/__onlineplugin__/wx92c68dae5a8bb046/1.1.0/appservice.js:985:5703) at Object.r.safeCallback (http://127.0.0.1:54459/appservice/__dev__/WAService.js:14:2008) at http://127.0.0.1:54459/appservice/__dev__/WAService.js:16:8772 at d (http://127.0.0.1:54459/appservice/__dev__/WAService.js:16:11173) at a (http://127.0.0.1:54459/appservice/appservice:1027:9451) at e.registerCallback (http://127.0.0.1:54459/appservice/appservice:1027:9638) at m.forEach (http://127.0.0.1:54459/appservice/appservice:1027:5612) at Array.forEach (<anonymous>)

考虑加入滑动切换月份嘛?

RT. 有时间的话可以贡献代码
本地已实现,切换月份好像没有提供外部接口? 我直接操作 month 的值实现。
另外,days-color 的 month 值为何只能设置到前后两个月?感觉直接设置月份的话需求会比较实际一点

配置后无法使用插件,是什么原因呢?

具体错误为:
jsEnginScriptError
Component is not found in path "pages/count/plugin:/wx92c68dae5a8bb046/calendar" (using by "pages/count/count")
Error: Component is not found in path "pages/count/plugin:/wx92c68dae5a8bb046/calendar" (using by "pages/count/count")

已经在第三方服务》插件管理中添加了插件,且显示为已通过

已经配置了app.json:
"plugins": {
"calendar": {
"version": "1.1.3",
"provider": "wx92c68dae5a8bb046"
}
}

已经在页面cout.json中配置了:
{
"usingComponents": {
"calendar": "plugin://calendar/calendar"
}
}

还有什么没配置或者我没搞明白了吗?

希望可以自定义初始日期

目前默认日期显示的是:今天的日期。
可否加添个方法:如果我传了值,就显示传值那一天的月份表;如果不传,默认就显示当天的月份表

日期单元格设置图片背景,真机上显示不出来

js里给日期单元格添加标记,模拟器上正常显示,真机上就显示不出来。试过很多种写法。

[
        { month: 'current', day: 12, background: 'url("../../asset/img/dot-active.png") center/100% no-repeat ' },
        { month: 'current', day: 17, background: 'url("/asset/img/dot-active.png")' },
        { month: 'current', day: 20, background: 'rgba(255, 255, 255,0) url("/asset/img/dot-active") center/100% no-repeat ' }
      ]

控件高度问题

你好,
我使用日历控件作为我页面的上半部分,下半部分有我其它的控件。
但是现在有一个问题是,页面加载完后,日历总是一部分被覆盖掉。
image

在开发工具里是不会被覆盖的。
image

接口文档中几个属性值初始化的问题

1.首先就是值的报错问题(year,month,day,start-date,end-date等),第一次进到嵌入插件的页面只要使用这几个属性且不是一个静态值而是通过{{}}绑定的js中的数值,都会报错,虽然不影响使用,但希望能优化一下。
2.第二个就是year,month的属性和start-date,end-date冲突的问题。我只设置了start-date,end-date,没设置year,month的时候就算start-date大于当前月,当前月也会显示,这个也是一个需要优化的问题。

点击具体日期报错

点击日历插件具体某天,会报第三方脚本错误

Cannot read property 'day' of undefined; [Component] Event Handler Error
TypeError: Cannot read property 'day' of undefined

目前进度:代码已修复,微信审核中。
修复版本:1.1.0

插件未授权

你好 我第一次使用插件,提示未授权怎么办?

结束日期bug

当前插件end-date属性存在bug,传入的参数被设置到了start-date。
已提交新版本进行修复,目前正在等待微信审核。
修复版本为1.1.1

如何在【点击日历具体某一天事件】添加长按效果

点击和长按实现不同的效果,我添加了了一个bindlongpress事件,但是长按进入方法后不能返回日期参数。大佬有什么建议没,或者在源码添加一个长按事件

<calendar
              weeks-type="cn"
              cell-size="40"
              lunar="true"
              next="{{true}}" prev="{{true}}" show-more-days="{{true}}"
              calendar-style="demo5-calendar"
              header-style="demo5-header"
              board-style="demo5-board"
              days-color="{{item.days_style}}"
              binddayClick="dayClick"
              bindnextMonth="dateChange"
              bindprevMonth="dateChange"
              binddateChange="dateChange"
              bindlongpress="longPress"
              />

event1

能否增加左右滑动切换上个月和下个月?

目前插件切换上个月和下个月的按钮触碰范围比较小,有的时候手指点击无法点击上触发事件区域,能否增加左右滑动来切换上个月和下个月,或者增大触碰区域,多谢!

days_style

demo5_days_style.push({ month: 'current', day: 20, color: 'white', background: '#aad4f5' });
current 应该只是当前月的20日改变颜色?事实是所有月的的20号都变成了#aad4f5

版本1.1.2引用报错

引入版本为1.1.2,按照文档操作 报错如下:
VM7003:1 jsEnginScriptError
Cannot read property 'version' of undefined
TypeError: Cannot read property 'version' of undefined

days_color设置无效

  1. 我在标签里面设置了days_color="{{days_style}}"
  2. 在js的data里面也定义了 days_style: [{ month: 'current', day: 1, color: 'white', background: 'red' }],但是没效果

遇到一个点击day,返回的年份错误!

首先设置可以展示上个月和下个月得数据,点击下个月一直到2018年12月份,在里面点击19年1月1号,返回数据 {year: 2018, month: 1, day: 1, color: "#4a4f74", lunarMonth: "冬月", …} ,年份给的是2018

希望能够在点击上一页下一页的时候自己来渲染数据

目前是点击上一页下一页的时候会把旧的数据再渲染一遍,如果我在next事件中渲染数据,就会渲染2遍。造成翻页的时候有拖影(小程序里面体现出来的)。

简单点说就是翻页之后的默认动作不要根据上/下月的数据来渲染本月。而是让用户自己在next/prev中去渲染。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.