精华内容
下载资源
问答
  • 下载带有农历的日历
    2021-06-11 15:37:16

    万年历农历日历app是为广大手机用户精心准备的一款手机日历应用软件,万年历农历日历app能为你提供最准确的农历时间,让你能够方便快捷的安排自己的事情,是一款功能十分强大的手机应用软件,有需要的朋友们欢迎前来下载使用!

    万年历农历日历app官方介绍:

    2016年农历万年历日历!

    集黄历、天气、记事、罗盘等于一身的生活好帮手 !看猴年生肖运势,就看顺历运势提醒!

    万年历农历日历app功能特色:

    1.专业喜庆择日:选个好日子结婚、旅行!

    2.天气预告:一周天气预告,穿衣建议,让你出门有温度有风度。

    3.贴心的节日提醒:港澳台地区节日提醒,应有尽有!

    4.传统黄历宜忌:关注每天该做的事,事事顺利!

    5.随身备忘录:搭配每日宜忌的记事,轻松安排日程。

    6.打牌财神罗盘:专业财神方位指示,打牌打麻将!

    更新内容:

    1.增加桌面透明日历部件,查看日历方便;

    2.改善中文英文自动适配问题,语言环境随你切换。

    版本记录

    2021-04-12版本: 1.4.6

    1.择吉界面美化\r\n2.操作交互优化\r\n3.修复桌面小工具bug

    2020-11-11版本: 1.4.2

    1、修复了部分安卓机型兼容问题.

    2020-09-10版本: 1.4.0

    1、修复了部分安卓机型兼容问题

    2020-08-20版本: 1.3.9

    1、修复了几个你看不到的bug,保佑你好运每一天!

    2、兼容Android X

    中文名:黄历万年历

    包名:com.yiqi.calendar

    MD5值:a7c1259c59c399b952e2e534930a2b12

    更多相关内容
  • php下实现农历日历的代码
  • 微软专为中国用户定制的带农历系统日历
  • 带有农历日历控件

    2021-04-02 15:22:13
    该案例是实现了一款很不错的带有农历日历控件源码,该源码简单易懂,而且也容易上手,案例可以实现显示阳历和阴历,显示范围是1900年到2100年。左右滑动手势切换月份,标题点击出现年份和月份选择器,“今天”按钮...
  • 带农历日历</TITLE>  [removed] <!–  var lunarInfo=new Array( 0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2, 0x04ae0,0x0a5b6,0x0a4d0,
  • 图片和演示a vue component for lunar fullcalendar. Uses Moment.js for date operations.Increase the functions of Chinese lunar calendar, 24 solar terms and holidays安装npm install --save vue-lunar-full-...
  • 带农历日历

    2014-11-06 17:30:21
    这就是一个带农历日历文件,只有当前月份的,注释已经写好了,可以根据个人需要进行修改,哪里错,请提出,我会尽快修改
  • 利用魔镜日历插件可以快速生成带农历日历、月历和年历,再也不用去素材网下载那些错误百出的年历素材了。魔镜日历插件测试支持CDR X8~2018,其他版本自行测试!…魔镜又推出了一款实用的cdr免费插件:魔镜日历插件...

    f0202c62a013ce910aceed7f394528ae.png

    魔镜日历插件-可生成带农历的日历月历年历-CDR插件

    书法字体2019.12.17日历插件

    魔镜又推出了一款实用的cdr免费插件:魔镜日历插件。利用魔镜日历插件可以快速生成带农历的日历、月历和年历,再也不用去素材网下载那些错误百出的年历素材了。魔镜日历插件测试支持CDR X8~2018,其他版本自行测试!…

    魔镜又推出了一款实用的cdr免费插件:魔镜日历插件。利用魔镜日历插件可以快速生成带农历的日历、月历和年历,再也不用去素材网下载那些错误百出的年历素材了。魔镜日历插件测试支持CDR X8~2018,其他版本自行测试!

    魔镜日历插件安装及用法

    8304e90f75199c49216172f281992c18.gif

    安装:在已经关闭CDR软件的情况下,双击魔镜日历插件安装包,然后勾选你的cdr版本,点“立即安装”即可,属于非常简单的一键安装方式。

    然后打开cdr,在菜单栏“窗口”——“泊坞窗”——“魔镜日历”打开魔镜日历插件界面。

    8304e90f75199c49216172f281992c18.gif

    用法:

    1、首先在日历那里选择你要生成的年份(默认为当前年份,比如你要生成2020年历,就在日历那里点选到2020年任意月份),然后点击“初始化模板”按钮,插件会自动导入一个标准的日历模板;

    2、导入的日历模板你可以任意修改字体、位置和大小,唯一要注意的是:模板中公农历是一个群组对象,你可以在不解散的情况下修改,也可以在解散的情况下修改,如果你解散了再修改,那么修改完后务必点击一下“指定为公、农日”按钮,使其符合模板的标准。最后全选模板,点击“模板分析”;

    3、点击“生成日历”按钮,稍等一会就会按你的模板位置生成你要的日历,非常简单方便,同时你还可以指定日历的横间距纵间距,以及设置周末颜色,节日颜色等等。

    8304e90f75199c49216172f281992c18.gif

    更加强大的CDR魔镜插件专业版

    0464ef4f3892b2d62c0c778cc80d9307.png

    CDR魔镜插件已经完美支持Coreldraw 2021版了。CDR魔镜插件是一款功能强大的Coreldraw(cdr)插件。很多CDR用户很早就接触过CDR魔镜插件免费版(CDR魔镜插件免费版已经非常强大,使...

    魔镜日历插件-可生成带农历的日历月历年历-CDR插件

    进入文件下载页面丨默认解压密码:www.epinv.com

    展开全文
  • 带有农历日历

    2012-01-31 10:55:50
    日历 带有农历,节气和休息日,一共两个文件,html和js。
  • 很漂亮的带农历日历控件,满足系统嵌入需求,即插即用。 完全源代码,可供任意借鉴参考和应用,无限制。
  • vue 农历日历

    2022-01-04 16:32:28
    前景: 客户要求 后台管理系统 (element-UI) 能够填报 员工的 农历生日 ! 试了 element 的 el-calendar 不是 很好用! 网上找到了此作者的笔记: https://blog.csdn.net/qq_32109661/article/details/87794155, 借鉴的...

    前景: 客户要求 后台管理系统 (element-UI) 能够填报 员工的 农历生日 !
    试了 element 的 el-calendar 不是 很好用!
    网上找到了此作者的笔记:
    https://blog.csdn.net/qq_32109661/article/details/87794155,
    借鉴的他的,现在 我把 根据需求 优化了一点点 后的 版本 分享给大家,
    希望能帮助到你 ! 嘿嘿()
    下面 我们进入正题:
    1:因为可能 很多地方要用,我把它直接封装成一个组件(如下图):

    2: 引入一个很关键的农历js,可自行百度,也可直接复制我下面分享的 !
    在这里插入图片描述
    3:效果图:
    在这里插入图片描述

    这里是dataPick.vue原码,可以直接拿着用,除了需要的数据处理那块,代码中我都有备注,你可自行修改:

    <template>
      <div class="main">
        <div class="choose_year">
          <div class="icon" @click="chooseYears(-1)"><i class="el-icon-d-arrow-left"></i></div>
          <div class="icon" @click="chooseMonth(-1)"><i class="el-icon-arrow-left"></i></div>
          <div class="date">{{year}}.{{month.toString().padStart(2, '0')}}</div>
          <div class="icon" @click="chooseMonth(1)"><i class="el-icon-arrow-right"></i></div>
          <div class="icon" @click="chooseYears(1)"><i class="el-icon-d-arrow-right"></i></div>
        </div>
        <div class="days_area">
          <div class="day week" v-for="week in weeks" :key="week">{{week}}</div>
          <div class="day" @click="chooseThisDay(day)"
               v-for="(day, index) in days" :key="index" :class="day.gregorian === today ? 'choose_day' : ''">
            <p>{{day.gregorian}} </p>
            <span>{{day.IDayCn}}</span>
          </div>
        </div>
      </div>
    </template>
    <script>
      import calendar from '@/utils/calendar'
      export default {
        name: 'datePick',
        data () {
          return {
            year: 0,
            month: 0,
            today: 0,
            days: [],
            weeks: ['一', '二', '三', '四', '五', '六', '日']
          }
        },
        mounted () {
          const now = new Date()
          this.year = now.getFullYear()
          this.month = now.getMonth() + 1
          this.today = now.getDate()
          this.getDays()
        },
        methods: {
          getDays () { // 获取当前月份所有公历日期及其农历日期
            this.days = []
            const day = new Date()
            day.setFullYear(this.year, this.month - 1, 1) // 此处较之前调整,获取当月第一天
            const month = new Date()
            month.setFullYear(this.year, this.month, 0) // 此处较之前调整,获取当月
            for (let i = 1; i < day.getDay(); i++) { // 当月第一天距离所在周周一的空白占位
              this.days.push({ gregorian: '', IDayCn: '', IMonthCn:'',lDay:'',lMonth:''})
            }
            for (let i = 1; i <= month.getDate(); i++) { // 获取当月天数填充日历
              let lunarCalendar = calendar.solar2lunar(this.year,this.month,i);
              this.days.push({ 
              //这里我只拿了我要的几个数据,你可以根据自己需要处理 ,lunarCalendar 数据很全
                gregorian: i,
                IDayCn: lunarCalendar.IDayCn,//初几等
                IMonthCn:lunarCalendar.IMonthCn,//正月等
                lDay:lunarCalendar.lDay,//农历日号
                lMonth:lunarCalendar.lMonth//农历月号
              })
            }
          },
          dateTransition(month,day){
            month = month >=10 ? month : '0'+ month;
            day = day >=10 ? day : '0'+day;
            return [month,day].join('');
          },
          chooseYears (state) { // 改变年份
            this.year += state
            this.today = 1
            this.getDays()
          },
          chooseMonth (state) { // 改变月份
            this.month += state
            this.today = 1
            if (this.month < 1) {
              this.month = 12
              this.chooseYears(-1)
            } else if (this.month > 12) {
              this.month = 1
              this.chooseYears(1)
            } else {
              this.getDays()
            }
          },
          //这里是我要的数据处理, 你用的时候可以根据自己需要做更改
          chooseThisDay (days) { // 选择某天
            if (days.gregorian > 0) {
              this.today = days.gregorian
            }
            let arr = this.dateTransition(days.lMonth,days.lDay);
            let {IDayCn,IMonthCn} = days
            let data  = {
              IDayCn , IMonthCn , arr
            }
            //把 处理好的数据 抛给父组件(即调用此组件的父组件)
            this.$emit('updateLunar', data);
          }
        }
      }
    </script>
    
    <style lang="scss" scoped>
      .main{
        .choose_year{
          display: flex;
          .icon{
            width: 10%;
            height: 8vh;
            line-height: 8vh;
            text-align: center;
          }
          .date{
            width: 60%;
            text-align: center;
            height: 8vh;
            line-height: 8vh;
            font-size: 1.2rem;
          }
        }
        .days_area{
          display: flex;
          flex-wrap: wrap;
          .day{
            width: 14.28%;
            text-align: center;
            padding: 1vh 0;
            margin-top: 1vh;
            p{
              margin: 0;
              font-size: 14px;
            }
            span{
              font-size: 14px;
            }
          }
          .week{
            background-color: dodgerblue;
            color: #fff;
            font-weight: bold;
            height: 6vh;
            line-height: 4vh;
            margin: 0;
          }
          .choose_day{
            background-color: dodgerblue;
            color: #fff;
            font-weight: bold;
          }
        }
      }
    </style>
    
    

    这里是calendar.js原码, 可以完完全全不做任何修改 直接使用 :

    /**
    * @1900-2100区间内的公历、农历互转
    * @charset UTF-8
    * @Author  Jea杨(JJonline@JJonline.Cn)
    * @Time    2014-7-21
    * @Time    2016-8-13 Fixed 2033hex、Attribution Annals
    * @Time    2016-9-25 Fixed lunar LeapMonth Param Bug
    * @Time    2017-7-24 Fixed use getTerm Func Param Error.use solar year,NOT lunar year
    * @Version 1.0.3
    * @公历转农历:calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]
    * @农历转公历:calendar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0]
    */
    const calendar = {
    
      /**
        * 农历1900-2100的润大小信息表
        * @Array Of Property
        * @return Hex
        */
      lunarInfo:[0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,//1900-1909
              0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,//1910-1919
              0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,//1920-1929
              0x06566,0x0d4a0,0x0ea50,0x16a95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,//1930-1939
              0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,//1940-1949
              0x06ca0,0x0b550,0x15355,0x04da0,0x0a5b0,0x14573,0x052b0,0x0a9a8,0x0e950,0x06aa0,//1950-1959
              0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,//1960-1969
              0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b6a0,0x195a6,//1970-1979
              0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,//1980-1989
              0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x05ac0,0x0ab60,0x096d5,0x092e0,//1990-1999
              0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,//2000-2009
              0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,//2010-2019
              0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,//2020-2029
              0x05aa0,0x076a3,0x096d0,0x04afb,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,//2030-2039
              0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0,//2040-2049
              /**Add By JJonline@JJonline.Cn**/
              0x14b63,0x09370,0x049f8,0x04970,0x064b0,0x168a6,0x0ea50, 0x06b20,0x1a6c4,0x0aae0,//2050-2059
              0x092e0,0x0d2e3,0x0c960,0x0d557,0x0d4a0,0x0da50,0x05d55,0x056a0,0x0a6d0,0x055d4,//2060-2069
              0x052d0,0x0a9b8,0x0a950,0x0b4a0,0x0b6a6,0x0ad50,0x055a0,0x0aba4,0x0a5b0,0x052b0,//2070-2079
              0x0b273,0x06930,0x07337,0x06aa0,0x0ad50,0x14b55,0x04b60,0x0a570,0x054e4,0x0d160,//2080-2089
              0x0e968,0x0d520,0x0daa0,0x16aa6,0x056d0,0x04ae0,0x0a9d4,0x0a2d0,0x0d150,0x0f252,//2090-2099
              0x0d520],//2100
    
      /**
        * 公历每个月份的天数普通表
        * @Array Of Property
        * @return Number
        */
      solarMonth:[31,28,31,30,31,30,31,31,30,31,30,31],
    
      /**
        * 天干地支之天干速查表
        * @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]
        * @return Cn string
        */
      Gan:["\u7532","\u4e59","\u4e19","\u4e01","\u620a","\u5df1","\u5e9a","\u8f9b","\u58ec","\u7678"],
    
      /**
        * 天干地支之地支速查表
        * @Array Of Property
        * @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
        * @return Cn string
        */
      Zhi:["\u5b50","\u4e11","\u5bc5","\u536f","\u8fb0","\u5df3","\u5348","\u672a","\u7533","\u9149","\u620c","\u4ea5"],
    
      /**
        * 天干地支之地支速查表<=>生肖
        * @Array Of Property
        * @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
        * @return Cn string
        */
      Animals:["\u9f20","\u725b","\u864e","\u5154","\u9f99","\u86c7","\u9a6c","\u7f8a","\u7334","\u9e21","\u72d7","\u732a"],
    
      /**
       * 阳历节日
       */
      festival: {
        '1-1':   {title: '元旦节'},
        '2-14':  {title: '情人节'},
        '5-1':   {title: '劳动节'},
        '5-4':   {title: '青年节'},
        '6-1':   {title: '儿童节'},
        '9-10':  {title: '教师节'},
        '10-1':  {title: '国庆节'},
        '12-25': {title: '圣诞节'},
    
        '3-8':   {title: '妇女节'},
        '3-12':  {title: '植树节'},
        '4-1':   {title: '愚人节'},
        '5-12':  {title: '护士节'},
        '7-1':   {title: '建党节'},
        '8-1':   {title: '建军节'},
        '12-24': {title: '平安夜'},
      },
    
      /**
       * 农历节日
       */
      lfestival: {
        '12-30': {title: '除夕'},
        '1-1':   {title: '春节'},
        '1-15':  {title: '元宵节'},
        '2-2':   {title: '龙抬头'},
        '5-5':   {title: '端午节'},
        '7-7':   {title: '七夕节'},
        '7-15':  {title: '中元节'},
        '8-15':  {title: '中秋节'},
        '9-9':   {title: '重阳节'},
        '10-1':  {title: '寒衣节'},
        '10-15': {title: '下元节'},
        '12-8':  {title: '腊八节'},
        '12-23':  {title: '北方小年'},
        '12-24':  {title: '南方小年'},
      },
    
      /**
       * 返回默认定义的阳历节日
       */
      getFestival(){
        return this.festival
      },
    
      /**
       * 返回默认定义的内容里节日
       */
      getLunarFestival(){
        return this.lfestival
      },
    
      /**
       *
       * @param {Object} 按照festival的格式输入数据,设置阳历节日
       */
      setFestival(param={}){
        this.festival = param
      },
    
      /**
       *
       * @param {Object} 按照lfestival的格式输入数据,设置农历节日
       */
      setLunarFestival(param={}){
        this.lfestival = param
      },
    
      /**
        * 24节气速查表
        * @Array Of Property
        * @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]
        * @return Cn string
        */
      solarTerm:["\u5c0f\u5bd2","\u5927\u5bd2","\u7acb\u6625","\u96e8\u6c34","\u60ca\u86f0","\u6625\u5206","\u6e05\u660e","\u8c37\u96e8","\u7acb\u590f","\u5c0f\u6ee1","\u8292\u79cd","\u590f\u81f3","\u5c0f\u6691","\u5927\u6691","\u7acb\u79cb","\u5904\u6691","\u767d\u9732","\u79cb\u5206","\u5bd2\u9732","\u971c\u964d","\u7acb\u51ac","\u5c0f\u96ea","\u5927\u96ea","\u51ac\u81f3"],
    
      /**
        * 1900-2100各年的24节气日期速查表
        * @Array Of Property
        * @return 0x string For splice
        */
      sTermInfo:['9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf97c3598082c95f8c965cc920f',
                '97bd0b06bdb0722c965ce1cfcc920f','b027097bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
                '97bcf97c359801ec95f8c965cc920f','97bd0b06bdb0722c965ce1cfcc920f','b027097bd097c36b0b6fc9274c91aa',
                '97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f','97bd0b06bdb0722c965ce1cfcc920f',
                'b027097bd097c36b0b6fc9274c91aa','9778397bd19801ec9210c965cc920e','97b6b97bd19801ec95f8c965cc920f',
                '97bd09801d98082c95f8e1cfcc920f','97bd097bd097c36b0b6fc9210c8dc2','9778397bd197c36c9210c9274c91aa',
                '97b6b97bd19801ec95f8c965cc920e','97bd09801d98082c95f8e1cfcc920f','97bd097bd097c36b0b6fc9210c8dc2',
                '9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec95f8c965cc920e','97bcf97c3598082c95f8e1cfcc920f',
                '97bd097bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec9210c965cc920e',
                '97bcf97c3598082c95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
                '97b6b97bd19801ec9210c965cc920e','97bcf97c3598082c95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722',
                '9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f',
                '97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
                '97bcf97c359801ec95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
                '97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f','97bd097bd07f595b0b6fc920fb0722',
                '9778397bd097c36b0b6fc9210c8dc2','9778397bd19801ec9210c9274c920e','97b6b97bd19801ec95f8c965cc920f',
                '97bd07f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c920e',
                '97b6b97bd19801ec95f8c965cc920f','97bd07f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2',
                '9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec9210c965cc920e','97bd07f1487f595b0b0bc920fb0722',
                '7f0e397bd097c36b0b6fc9210c8dc2','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
                '97bcf7f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
                '97b6b97bd19801ec9210c965cc920e','97bcf7f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
                '9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf7f1487f531b0b0bb0b6fb0722',
                '7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
                '97bcf7f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
                '97b6b97bd19801ec9210c9274c920e','97bcf7f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
                '9778397bd097c36b0b6fc9210c91aa','97b6b97bd197c36c9210c9274c920e','97bcf7f0e47f531b0b0bb0b6fb0722',
                '7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c920e',
                '97b6b7f0e47f531b0723b0b6fb0722','7f0e37f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2',
                '9778397bd097c36b0b70c9274c91aa','97b6b7f0e47f531b0723b0b6fb0721','7f0e37f1487f595b0b0bb0b6fb0722',
                '7f0e397bd097c35b0b6fc9210c8dc2','9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721',
                '7f0e27f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
                '97b6b7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
                '9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
                '7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721',
                '7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9274c91aa',
                '97b6b7f0e47f531b0723b0787b0721','7f0e27f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
                '9778397bd097c36b0b6fc9210c91aa','97b6b7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
                '7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9210c8dc2','977837f0e37f149b0723b0787b0721',
                '7f07e7f0e47f531b0723b0b6fb0722','7f0e37f5307f595b0b0bc920fb0722','7f0e397bd097c35b0b6fc9210c8dc2',
                '977837f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0721','7f0e37f1487f595b0b0bb0b6fb0722',
                '7f0e397bd097c35b0b6fc9210c8dc2','977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
                '7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','977837f0e37f14998082b0787b06bd',
                '7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
                '977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
                '7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
                '7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14998082b0787b06bd',
                '7f07e7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
                '977837f0e37f14998082b0723b06bd','7f07e7f0e37f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
                '7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b0721',
                '7f07e7f0e47f531b0723b0b6fb0722','7f0e37f1487f595b0b0bb0b6fb0722','7f0e37f0e37f14898082b0723b02d5',
                '7ec967f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0722','7f0e37f1487f531b0b0bb0b6fb0722',
                '7f0e37f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
                '7f0e37f1487f531b0b0bb0b6fb0722','7f0e37f0e37f14898082b072297c35','7ec967f0e37f14998082b0787b06bd',
                '7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e37f0e37f14898082b072297c35',
                '7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
                '7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f149b0723b0787b0721',
                '7f0e27f1487f531b0b0bb0b6fb0722','7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14998082b0723b06bd',
                '7f07e7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722','7f0e37f0e366aa89801eb072297c35',
                '7ec967f0e37f14998082b0723b06bd','7f07e7f0e37f14998083b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
                '7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14898082b0723b02d5','7f07e7f0e37f14998082b0787b0721',
                '7f07e7f0e47f531b0723b0b6fb0722','7f0e36665b66aa89801e9808297c35','665f67f0e37f14898082b0723b02d5',
                '7ec967f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0722','7f0e36665b66a449801e9808297c35',
                '665f67f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
                '7f0e36665b66a449801e9808297c35','665f67f0e37f14898082b072297c35','7ec967f0e37f14998082b0787b06bd',
                '7f07e7f0e47f531b0723b0b6fb0721','7f0e26665b66a449801e9808297c35','665f67f0e37f1489801eb072297c35',
                '7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722'],
    
      /**
        * 数字转中文速查表
        * @Array Of Property
        * @trans ['日','一','二','三','四','五','六','七','八','九','十']
        * @return Cn string
        */
      nStr1:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341"],
    
      /**
        * 日期转农历称呼速查表
        * @Array Of Property
        * @trans ['初','十','廿','卅']
        * @return Cn string
        */
      nStr2:["\u521d","\u5341","\u5eff","\u5345"],
    
      /**
        * 月份转农历称呼速查表
        * @Array Of Property
        * @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
        * @return Cn string
        */
      nStr3:["\u6b63","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u51ac","\u814a"],
    
      /**
        * 返回农历y年一整年的总天数
        * @param lunar Year
        * @return Number
        * @eg:var count = calendar.lYearDays(1987) ;//count=387
        */
      lYearDays:function(y) {
          var i, sum = 348;
          for(i=0x8000; i>0x8; i>>=1) { sum += (this.lunarInfo[y-1900] & i)? 1: 0; }
          return(sum+this.leapDays(y));
      },
    
      /**
        * 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
        * @param lunar Year
        * @return Number (0-12)
        * @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
        */
      leapMonth:function(y) { //闰字编码 \u95f0
          return(this.lunarInfo[y-1900] & 0xf);
      },
    
      /**
        * 返回农历y年闰月的天数 若该年没有闰月则返回0
        * @param lunar Year
        * @return Number (0、29、30)
        * @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
        */
      leapDays:function(y) {
          if(this.leapMonth(y))  {
              return((this.lunarInfo[y-1900] & 0x10000)? 30: 29);
          }
          return(0);
      },
    
      /**
        * 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
        * @param lunar Year
        * @return Number (-1、29、30)
        * @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
        */
      monthDays:function(y,m) {
          if(m>12 || m<1) {return -1}//月份参数从1至12,参数错误返回-1
          return( (this.lunarInfo[y-1900] & (0x10000>>m))? 30: 29 );
      },
    
      /**
        * 返回公历(!)y年m月的天数
        * @param solar Year
        * @return Number (-1、28、29、30、31)
        * @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
        */
      solarDays:function(y,m) {
          if(m>12 || m<1) {return -1} //若参数错误 返回-1
          var ms = m-1;
          if(ms==1) { //2月份的闰平规律测算后确认返回28或29
              return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28);
          }else {
              return(this.solarMonth[ms]);
          }
      },
    
      /**
       * 农历年份转换为干支纪年
       * @param  lYear 农历年的年份数
       * @return Cn string
       */
      toGanZhiYear:function(lYear) {
          var ganKey = (lYear - 3) % 10;
          var zhiKey = (lYear - 3) % 12;
          if(ganKey == 0) ganKey = 10;//如果余数为0则为最后一个天干
          if(zhiKey == 0) zhiKey = 12;//如果余数为0则为最后一个地支
          return this.Gan[ganKey-1] + this.Zhi[zhiKey-1];
    
      },
    
      /**
       * 公历月、日判断所属星座
       * @param  cMonth [description]
       * @param  cDay [description]
       * @return Cn string
       */
      toAstro:function(cMonth,cDay) {
          var s   = "\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf";
          var arr = [20,19,21,21,21,22,23,23,23,23,22,22];
          return s.substr(cMonth*2 - (cDay < arr[cMonth-1] ? 2 : 0),2) + "\u5ea7";//座
      },
    
      /**
        * 传入offset偏移量返回干支
        * @param offset 相对甲子的偏移量
        * @return Cn string
        */
      toGanZhi:function(offset) {
          return this.Gan[offset%10] + this.Zhi[offset%12];
      },
    
      /**
        * 传入公历(!)y年获得该年第n个节气的公历日期
        * @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
        * @return day Number
        * @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
        */
      getTerm:function(y,n) {
          if(y<1900 || y>2100) {return -1;}
          if(n<1 || n>24) {return -1;}
          var _table = this.sTermInfo[y-1900];
          var _info = [
              parseInt('0x'+_table.substr(0,5)).toString() ,
              parseInt('0x'+_table.substr(5,5)).toString(),
              parseInt('0x'+_table.substr(10,5)).toString(),
              parseInt('0x'+_table.substr(15,5)).toString(),
              parseInt('0x'+_table.substr(20,5)).toString(),
              parseInt('0x'+_table.substr(25,5)).toString()
          ];
          var _calday = [
              _info[0].substr(0,1),
              _info[0].substr(1,2),
              _info[0].substr(3,1),
              _info[0].substr(4,2),
    
              _info[1].substr(0,1),
              _info[1].substr(1,2),
              _info[1].substr(3,1),
              _info[1].substr(4,2),
    
              _info[2].substr(0,1),
              _info[2].substr(1,2),
              _info[2].substr(3,1),
              _info[2].substr(4,2),
    
              _info[3].substr(0,1),
              _info[3].substr(1,2),
              _info[3].substr(3,1),
              _info[3].substr(4,2),
    
              _info[4].substr(0,1),
              _info[4].substr(1,2),
              _info[4].substr(3,1),
              _info[4].substr(4,2),
    
              _info[5].substr(0,1),
              _info[5].substr(1,2),
              _info[5].substr(3,1),
              _info[5].substr(4,2),
          ];
          return parseInt(_calday[n-1]);
      },
    
      /**
        * 传入农历数字月份返回汉语通俗表示法
        * @param lunar month
        * @return Cn string
        * @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
        */
      toChinaMonth:function(m) { // 月 => \u6708
          if(m>12 || m<1) {return -1} //若参数错误 返回-1
          var s = this.nStr3[m-1];
          s+= "\u6708";//加上月字
          return s;
      },
    
      /**
        * 传入农历日期数字返回汉字表示法
        * @param lunar day
        * @return Cn string
        * @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
        */
      toChinaDay:function(d){ //日 => \u65e5
          var s;
          switch (d) {
              case 10:
              s = '\u521d\u5341'; break;
          case 20:
              s = '\u4e8c\u5341'; break;
              break;
          case 30:
              s = '\u4e09\u5341'; break;
              break;
          default :
              s = this.nStr2[Math.floor(d/10)];
              s += this.nStr1[d%10];
          }
          return(s);
      },
    
      /**
        * 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
        * @param y year
        * @return Cn string
        * @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
        */
      getAnimal: function(y) {
          return this.Animals[(y - 4) % 12]
      },
    
      /**
        * 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
        * @param y  solar year
        * @param m  solar month
        * @param d  solar day
        * @return JSON object
        * @eg:console.log(calendar.solar2lunar(1987,11,01));
        */
      solar2lunar:function (y,m,d) { //参数区间1900.1.31~2100.12.31
          y = parseInt(y)
          m = parseInt(m)
          d = parseInt(d)
          //年份限定、上限
          if(y<1900 || y>2100) {
              return -1;// undefined转换为数字变为NaN
          }
          //公历传参最下限
          if(y==1900&&m==1&&d<31) {
              return -1;
          }
          //未传参  获得当天
          if(!y) {
              var objDate = new Date();
          }else {
              var objDate = new Date(y,parseInt(m)-1,d)
          }
          var i, leap=0, temp=0;
          //修正ymd参数
          var y = objDate.getFullYear(),
              m = objDate.getMonth()+1,
              d = objDate.getDate();
          var offset = (Date.UTC(objDate.getFullYear(),objDate.getMonth(),objDate.getDate()) - Date.UTC(1900,0,31))/86400000;
          for(i=1900; i<2101 && offset>0; i++) {
              temp    = this.lYearDays(i);
              offset -= temp;
          }
          if(offset<0) {
              offset+=temp; i--;
          }
    
          //是否今天
          var isTodayObj = new Date(),
              isToday    = false;
          if(isTodayObj.getFullYear()==y && isTodayObj.getMonth()+1==m && isTodayObj.getDate()==d) {
              isToday = true;
          }
          //星期几
          var nWeek = objDate.getDay(),
             cWeek  = this.nStr1[nWeek];
          //数字表示周几顺应天朝周一开始的惯例
          if(nWeek==0) {
              nWeek = 7;
          }
          //农历年
          var year   = i;
          var leap   = this.leapMonth(i); //闰哪个月
          var isLeap = false;
    
          //效验闰月
          for(i=1; i<13 && offset>0; i++) {
              //闰月
              if(leap>0 && i==(leap+1) && isLeap==false){
                  --i;
                  isLeap = true; temp = this.leapDays(year); //计算农历闰月天数
              }
              else{
                  temp = this.monthDays(year, i);//计算农历普通月天数
              }
              //解除闰月
              if(isLeap==true && i==(leap+1)) { isLeap = false; }
              offset -= temp;
          }
          // 闰月导致数组下标重叠取反
          if(offset==0 && leap>0 && i==leap+1)
          {
              if(isLeap){
                  isLeap = false;
              }else{
                  isLeap = true; --i;
              }
          }
          if(offset<0)
          {
              offset += temp; --i;
          }
          //农历月
          var month      = i;
          //农历日
          var day        = offset + 1;
          //天干地支处理
          var sm         = m-1;
          var gzY        = this.toGanZhiYear(year);
    
          // 当月的两个节气
          // bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year`
          var firstNode  = this.getTerm(y,(m*2-1));//返回当月「节」为几日开始
          var secondNode = this.getTerm(y,(m*2));//返回当月「节」为几日开始
    
          // 依据12节气修正干支月
          var gzM        = this.toGanZhi((y-1900)*12+m+11);
          if(d>=firstNode) {
              gzM        = this.toGanZhi((y-1900)*12+m+12);
          }
    
          //传入的日期的节气与否
          var isTerm = false;
          var Term   = null;
          if(firstNode==d) {
              isTerm  = true;
              Term    = this.solarTerm[m*2-2];
          }
          if(secondNode==d) {
              isTerm  = true;
              Term    = this.solarTerm[m*2-1];
          }
          //日柱 当月一日与 1900/1/1 相差天数
          var dayCyclical = Date.UTC(y,sm,1,0,0,0,0)/86400000+25567+10;
          var gzD         = this.toGanZhi(dayCyclical+d-1);
          //该日期所属的星座
          var astro       = this.toAstro(m,d);
    
          var solarDate = y+'-'+m+'-'+d
          var lunarDate = year+'-'+month+'-'+day
    
          var festival = this.festival
          var lfestival = this.lfestival
    
          var festivalDate = m+'-'+d
          var lunarFestivalDate = month+'-'+day
    
          return {
            date: solarDate,
            lunarDate: lunarDate,
            festival: festival[festivalDate] ? festival[festivalDate].title : null,
            lunarFestival: lfestival[lunarFestivalDate] ? lfestival[lunarFestivalDate].title : null,
            'lYear':year,
            'lMonth':month,
            'lDay':day,
            'Animal':this.getAnimal(year),
            'IMonthCn':(isLeap?"\u95f0":'')+this.toChinaMonth(month),
            'IDayCn':this.toChinaDay(day),
            'cYear':y,
            'cMonth':m,
            'cDay':d,
            'gzYear':gzY,
            'gzMonth':gzM,
            'gzDay':gzD,
            'isToday':isToday,
            'isLeap':isLeap,
            'nWeek':nWeek,
            'ncWeek':"\u661f\u671f"+cWeek,
            'isTerm':isTerm,
            'Term':Term,
            'astro':astro
          };
      },
    
      /**
        * 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
        * @param y  lunar year
        * @param m  lunar month
        * @param d  lunar day
        * @param isLeapMonth  lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
        * @return JSON object
        * @eg:console.log(calendar.lunar2solar(1987,9,10));
        */
      lunar2solar:function(y,m,d,isLeapMonth) {   //参数区间1900.1.31~2100.12.1
          y = parseInt(y)
          m = parseInt(m)
          d = parseInt(d)
          var isLeapMonth = !!isLeapMonth;
          var leapOffset  = 0;
          var leapMonth   = this.leapMonth(y);
          var leapDay     = this.leapDays(y);
          if(isLeapMonth&&(leapMonth!=m)) {return -1;}//传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
          if(y==2100&&m==12&&d>1 || y==1900&&m==1&&d<31) {return -1;}//超出了最大极限值
          var day  = this.monthDays(y,m);
          var _day = day;
          //bugFix 2016-9-25
          //if month is leap, _day use leapDays method
          if(isLeapMonth) {
              _day = this.leapDays(y,m);
          }
          if(y < 1900 || y > 2100 || d > _day) {return -1;}//参数合法性效验
    
          //计算农历的时间差
          var offset = 0;
          for(var i=1900;i<y;i++) {
              offset+=this.lYearDays(i);
          }
          var leap = 0,isAdd= false;
          for(var i=1;i<m;i++) {
              leap = this.leapMonth(y);
              if(!isAdd) {//处理闰月
                  if(leap<=i && leap>0) {
                      offset+=this.leapDays(y);isAdd = true;
                  }
              }
              offset+=this.monthDays(y,i);
          }
          //转换闰月农历 需补充该年闰月的前一个月的时差
          if(isLeapMonth) {offset+=day;}
          //1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
          var stmap   =   Date.UTC(1900,1,30,0,0,0);
          var calObj  =   new Date((offset+d-31)*86400000+stmap);
          var cY      =   calObj.getUTCFullYear();
          var cM      =   calObj.getUTCMonth()+1;
          var cD      =   calObj.getUTCDate();
    
          return this.solar2lunar(cY,cM,cD);
      }
    };
    export default calendar;
    
    

    到此处完结, 希望能够帮助到你 , 愿我们都在前进的道路上越来越顺 !!!

    展开全文
  • VC 支持时间日期的万年历 带农历日历,有人说这只是一个时钟,不过我觉得功能已远远超出时钟了,有日历可供查询,而且还带有农历,还有定时关机和定时提醒功能,还可以使用热键操作窗口的隐藏与显示,如果喜欢学习的...
  • 带农历的小日历插件

    2013-01-21 16:31:13
    一个黄道吉日的很方便、很简单的、很全面的带农历的小日历小插件
  • vue —— 带农历日历功能

    千次阅读 2019-02-20 14:24:59
    之前个项目需要自己写一个月份选择器,由此想起来做一个简单的日历,做起来一些自己感兴趣的东西,也为了记录一下,发个帖 首先,我做的日历是没有农历的,因为我不知道农历的历法是怎么计算的,从网上找了一个...

    闲来无事做一些简单功能,一边练习VUE的使用,一边锻炼逻辑思维能力。之前有个项目需要自己写一个月份选择器,由此想起来做一个简单的日历,做起来有一些自己感兴趣的东西,也为了记录一下,发个帖

    首先,我做的日历是没有农历的,因为我不知道农历的历法是怎么计算的,从网上找了一个似乎是很多年前的代码,功能不错,代码太乱就自己整理了一下,当然这段代码还是归写代码的大神所有,跟我没啥关系,特此声明

    1、分享代码

    Html代码

    <template>
      <div class="main">
        <div class="choose_year">
          <div class="icon" @click="chooseYears(-1)"><i class="fa fa-angle-double-left"></i></div>
          <div class="icon" @click="chooseMonth(-1)"><i class="fa fa-angle-left"></i></div>
          <div class="date">{{year}}.{{month.toString().padStart(2, '0')}}</div>
          <div class="icon" @click="chooseMonth(1)"><i class="fa fa-angle-right"></i></div>
          <div class="icon" @click="chooseYears(1)"><i class="fa fa-angle-double-right"></i></div>
        </div>
        <div class="days_area">
          <div class="day week" v-for="week in weeks" :key="week">{{week}}</div>
          <div class="day" @click="chooseThisDay(day.gregorian)" v-for="(day, index) in days" :key="index" :class="day.gregorian === today ? 'choose_day' : ''">
            <p>{{day.gregorian}}</p>
            <span>{{day.lunar}}</span>
          </div>
        </div>
      </div>
    </template>

    SCSS代码

    <style lang="scss" scoped>
      .main{
        .choose_year{
          display: flex;
          .icon{
            width: 10%;
            height: 8vh;
            line-height: 8vh;
            text-align: center;
          }
          .date{
            width: 60%;
            text-align: center;
            height: 8vh;
            line-height: 8vh;
            font-size: 1.2rem;
          }
        }
        .days_area{
          display: flex;
          flex-wrap: wrap;
          .day{
            width: 14.28%;
            text-align: center;
            padding: 1vh 0;
            margin-top: 1vh;
            p{
              margin: 0;
              font-size: 6vw;
            }
            span{
              font-size: 3vw;
            }
          }
          .week{
            background-color: dodgerblue;
            color: #fff;
            font-weight: bold;
            height: 6vh;
            line-height: 4vh;
            margin: 0;
          }
          .choose_day{
            background-color: dodgerblue;
            color: #fff;
            font-weight: bold;
          }
        }
      }
    </style>

    效果图

     

    当然效果很一般啦,如果你要这种日历的话,自己精心调校一下样式应该...也比我好不到哪里去吧,哈哈哈哈

    JS代码

    export default {
      name: 'calendar',
      data () {
        return {
          year: 0,
          month: 0,
          today: 0,
          days: [],
          weeks: ['一', '二', '三', '四', '五', '六', '日']
        }
      },
      mounted () {
        const now = new Date()
        this.year = now.getFullYear()
        this.month = now.getMonth() + 1
        this.today = now.getDate()
        this.getDays()
      },
      methods: {
        getDays () { // 获取当前月份所有公历日期及其农历日期
          this.days = []
          const day = new Date()
          day.setFullYear(this.year, this.month - 1, 1) // 此处较之前调整,获取当月第一天
          const month = new Date()
          month.setFullYear(this.year, this.month, 0) // 此处较之前调整,获取当月
          for (let i = 1; i < day.getDay(); i++) { // 当月第一天距离所在周周一的空白占位
            this.days.push({ gregorian: '', lunar: '' })
          }
          for (let i = 1; i <= month.getDate(); i++) { // 获取当月天数填充日历
            this.days.push({ gregorian: i, lunar: this.getLunarDay(this.year, this.month, i) })
          }
        },
        chooseYears (state) { // 改变年份
          this.year += state
          this.today = 1
          this.getDays()
        },
        chooseMonth (state) { // 改变月份
          this.month += state
          this.today = 1
          if (this.month < 1) {
            this.month = 12
            this.chooseYears(-1)
          } else if (this.month > 12) {
            this.month = 1
            this.chooseYears(1)
          } else {
            this.getDays()
          }
        },
        chooseThisDay (day) { // 选择某天,主要是考虑可以当时间选择器用
          if (day > 0) {
            this.today = day
          }
        },
        getLunarDay (solarYear, solarMonth, solarDay) { // 拷贝别人又自己调整过的获取农历日期的代码,想要原来的代码估计百度一下就有了
          const madd = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334]
          // const tgString = '甲乙丙丁戊己庚辛壬癸'
          // const dzString = '子丑寅卯辰巳午未申酉戌亥'
          const numString = '一二三四五六七八九十'
          const monString = '正二三四五六七八九十冬腊'
          const CalendarData = [0xA4B, 0x5164B, 0x6A5, 0x6D4, 0x415B5, 0x2B6, 0x957, 0x2092F, 0x497, 0x60C96, 0xD4A, 0xEA5, 0x50DA9, 0x5AD, 0x2B6, 0x3126E, 0x92E, 0x7192D, 0xC95, 0xD4A, 0x61B4A, 0xB55, 0x56A, 0x4155B, 0x25D, 0x92D, 0x2192B, 0xA95, 0x71695, 0x6CA, 0xB55, 0x50AB5, 0x4DA, 0xA5B, 0x30A57, 0x52B, 0x8152A, 0xE95, 0x6AA, 0x615AA, 0xAB5, 0x4B6, 0x414AE, 0xA57, 0x526, 0x31D26, 0xD95, 0x70B55, 0x56A, 0x96D, 0x5095D, 0x4AD, 0xA4D, 0x41A4D, 0xD25, 0x81AA5, 0xB54, 0xB6A, 0x612DA, 0x95B, 0x49B, 0x41497, 0xA4B, 0xA164B, 0x6A5, 0x6D4, 0x615B4, 0xAB6, 0x957, 0x5092F, 0x497, 0x64B, 0x30D4A, 0xEA5, 0x80D65, 0x5AC, 0xAB6, 0x5126D, 0x92E, 0xC96, 0x41A95, 0xD4A, 0xDA5, 0x20B55, 0x56A, 0x7155B, 0x25D, 0x92D, 0x5192B, 0xA95, 0xB4A, 0x416AA, 0xAD5, 0x90AB5, 0x4BA, 0xA5B, 0x60A57, 0x52B, 0xA93, 0x40E95]
          if (!(solarYear < 1921 || solarYear > 2999)) { // 注意看此处限定了年份,设置自己需要的范围即可
            solarMonth = (parseInt(solarMonth) > 0) ? (solarMonth - 1) : 11
            const timeArr = [solarYear, solarMonth, solarDay]
            let TheDate = (timeArr.length !== 3) ? new Date() : new Date(timeArr[0], timeArr[1], timeArr[2])
            let total, m, n, k
            let isEnd = false
            let theDateYear = TheDate.getFullYear()
            total = (theDateYear - 1921) * 365 + Math.floor((theDateYear - 1921) / 4) + madd[TheDate.getMonth()] + TheDate.getDate() - 38
            if (theDateYear % 4 === 0 && TheDate.getMonth() > 1) {
              total++
            }
            for (m = 0; ; m++) {
              k = (CalendarData[m] < 0xfff) ? 11 : 12
              for (n = k; n >= 0; n--) {
                if (total <= this.getBit(CalendarData[m], n)) {
                  isEnd = true
                  break
                }
                total = total - this.getBit(CalendarData[m], n)
              }
              if (isEnd) {
                break
              }
            }
            let cMonth, cDay // cYear,
            // cYear = 1921 + m
            cMonth = k - n + 1
            cDay = total
            if (k === 12) {
              if (cMonth === Math.floor(CalendarData[m] / 0x10000) + 1) {
                cMonth = 1 - cMonth
              }
              if (cMonth > Math.floor(CalendarData[m] / 0x10000) + 1) {
                cMonth--
              }
            }
            // let run = ''
            let cDayStr = numString.charAt(cDay - 1)
            /* if (cMonth < 1) {
              run = '(闰)'
            } */
            if (cDay % 10 !== 0 || cDay === 10) {
              cDayStr = numString.charAt((cDay - 1) % 10)
            }
            return cDay === 1 ? monString.charAt(cMonth - 1) + '月' : (cDay < 11 ? '初' : (cDay < 20 ? '十' : (cDay < 30 ? '廿' : '三十'))) + cDayStr // tgString.charAt((cYear - 4) % 10) + dzString.charAt((cYear - 4) % 12) + '年 ' + run + monString.charAt(cMonth - 1) + '月' +
          }
        },
        getBit (m, n) { // 也是拷贝的,不是很明白这段代码干嘛的,不过很明显是处理二进制数据的
          return 29 + ((m >> n) & 1)
        }
      }
    }

    OK,代码就这些,有需要的话随便取用,除了我也不是很明白的农历日期计算之外,其他都是我写得简单代码,没什么技术含量,也就不需要赘述了

    展开全文
  • num2: '110', num3: '90', start: '2021-11-25', end: '2021-11-27' }, ], events: [], // 日程数组 // 相关配置 config: { lunarCalendar: true, // 是否显示农历 fixedWeekCount: false,// 设置false没有显示5周...
  • 本文实例为大家分享了js实现带农历等信息的日历特效,代码量很大,供大家参考,具体内容如下 效果图: 实现代码: <HTML> <HEAD> <TITLE>万年历</TITLE> <META content="农历; 阳历...
  • 漂亮的VB桌面日历,不但会显示天气预报,带有农历,还能显示甲、乙、"丙、盯戊、己、庚、辛等古代历法,另外还会显示星座及星期几,如果这一天是情人节,它还会提示你,你的Ip它也将获取出来告诉你,一个透明的小...
  • 既然要显示日期表格的话,首先得知道这个表格多少行多少列,列数是已经确定的,从星期天(日历上第1列是星期天)到星期六一共7列。要解决行数问题之前,还得先知道这个月的第1天是星期几,因为每个月的1号并不都是...
  • 一款使用jquery结合swiper.js来制作的手机端带农历的万年历插件。该万年历类似百度的万年历,带有农历日期。用户可以通过类似iphone的滚轮来选择不同的的日期。
  • 带农历的脚本: http://keleyi.com/keleyi/phtml/jstexiao/11.htm http://keleyi.com/tools/rili/ 1 <html> 2 <head> 3 <meta ...带农历日历</TITLE> 5 <S
  • 带有农历的JC日历

    2008-04-12 20:14:28
    利用JCalendar,增加了一个中国农历的部分;不过在ff显示还有点问题
  • 2020年即将来临,小编则为大家送上2020年日历全年表Excel A4带农历打印版,该版本可以直接编辑打印,大大方便了需要打印的用户, 而且日历上还标注了农历哦,需要的小伙伴爱自取。介绍说明2020年是一个闰年,它的...
  • vue-jLunar-datePicker @JinWen Lunar-Date-Picker组件,lightWeight,功能强大,易于使用,带有节日和节假日术语。 在线演示使用de vue-jLunar-datePicker @JinWen Lunar-Date-Picker组件,重量轻,功能强大,易于...
  • 编程语言VB.NET(VS2010),可查阅1900年—2050年,显示农历以及节假日等,内源码
  • 新手小白无聊时做的一个 日历控件,需要的朋友可以借鉴下,高手大神也可以指点一下。 核心代码 获取某年某月多少天 /// 获取某年某月多少天 /// </summary> /// <param name="_year">年份</...
  • 用java 编写的 万年历程序 可实现农历公历转换和记事本功能
  • 经手了一个项目,要求前端实现一个带有农历、节假日、节气的前端日历,类似万年历的样子。当时查了一些资料,都是一些零零散散的,要么就只有农历,要么只有传统节假日,还有一些对于节气的判断,各种语言的都有,看...
  • 在写这个组件之前,朋友问我,为什么ui框架里面有日历组件,你还要去写?究竟什么意义? 其实意义非常大,首先不同的项目用的ui框架也会不一样,功能也会些许差异,在功能不能满足你需求的情况下,是另外装一...
  • Java实现日历包括农历,节日,节气

    千次阅读 2021-01-10 14:20:50
    } // 返回日期数组的空数据个数,即1号所在行中多少个空位置 // 1号不一定是在该月日历中的第一个位置 public int getweekDay() { Calendar calendar = Calendar.getInstance(); calendar.set(year, ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 1,498
精华内容 599
关键字:

下载带有农历的日历