@gmcb/uv-ui 0.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +295 -0
- package/LICENSE +21 -0
- package/README.md +164 -0
- package/components/uv-action-sheet/props.js +50 -0
- package/components/uv-action-sheet/uv-action-sheet.vue +280 -0
- package/components/uv-album/uv-album.vue +312 -0
- package/components/uv-alert/props.js +45 -0
- package/components/uv-alert/uv-alert.vue +246 -0
- package/components/uv-avatar/props.js +85 -0
- package/components/uv-avatar/uv-avatar.vue +182 -0
- package/components/uv-avatar-group/props.js +53 -0
- package/components/uv-avatar-group/uv-avatar-group.vue +106 -0
- package/components/uv-back-top/props.js +58 -0
- package/components/uv-back-top/uv-back-top.vue +116 -0
- package/components/uv-badge/props.js +73 -0
- package/components/uv-badge/uv-badge.vue +176 -0
- package/components/uv-button/nvue.scss +46 -0
- package/components/uv-button/props.js +163 -0
- package/components/uv-button/uv-button.vue +529 -0
- package/components/uv-button/vue.scss +93 -0
- package/components/uv-calendar/calendar.js +546 -0
- package/components/uv-calendar/header.vue +104 -0
- package/components/uv-calendar/month.vue +616 -0
- package/components/uv-calendar/props.js +145 -0
- package/components/uv-calendar/uv-calendar.vue +390 -0
- package/components/uv-calendars/calendar-body.vue +376 -0
- package/components/uv-calendars/calendar-item.vue +248 -0
- package/components/uv-calendars/calendar.js +546 -0
- package/components/uv-calendars/i18n/en.json +12 -0
- package/components/uv-calendars/i18n/index.js +8 -0
- package/components/uv-calendars/i18n/zh-Hans.json +12 -0
- package/components/uv-calendars/i18n/zh-Hant.json +12 -0
- package/components/uv-calendars/util.js +435 -0
- package/components/uv-calendars/uv-calendars.vue +452 -0
- package/components/uv-cell/props.js +116 -0
- package/components/uv-cell/uv-cell.vue +209 -0
- package/components/uv-cell-group/props.js +15 -0
- package/components/uv-cell-group/uv-cell-group.vue +63 -0
- package/components/uv-checkbox/props.js +70 -0
- package/components/uv-checkbox/uv-checkbox.vue +371 -0
- package/components/uv-checkbox-group/props.js +84 -0
- package/components/uv-checkbox-group/uv-checkbox-group.vue +119 -0
- package/components/uv-code/props.js +35 -0
- package/components/uv-code/uv-code.vue +136 -0
- package/components/uv-code-input/props.js +83 -0
- package/components/uv-code-input/uv-code-input.vue +272 -0
- package/components/uv-col/props.js +30 -0
- package/components/uv-col/uv-col.vue +165 -0
- package/components/uv-collapse/props.js +20 -0
- package/components/uv-collapse/uv-collapse.vue +86 -0
- package/components/uv-collapse-item/props.js +60 -0
- package/components/uv-collapse-item/uv-collapse-item.vue +228 -0
- package/components/uv-column-notice/props.js +61 -0
- package/components/uv-column-notice/uv-column-notice.vue +176 -0
- package/components/uv-count-down/props.js +25 -0
- package/components/uv-count-down/utils.js +62 -0
- package/components/uv-count-down/uv-count-down.vue +169 -0
- package/components/uv-count-to/props.js +60 -0
- package/components/uv-count-to/uv-count-to.vue +187 -0
- package/components/uv-datetime-picker/props.js +130 -0
- package/components/uv-datetime-picker/uv-datetime-picker.vue +355 -0
- package/components/uv-divider/props.js +45 -0
- package/components/uv-divider/uv-divider.vue +113 -0
- package/components/uv-drop-down/uv-drop-down.vue +135 -0
- package/components/uv-drop-down-item/uv-drop-down-item.vue +169 -0
- package/components/uv-drop-down-popup/uv-drop-down-popup.vue +242 -0
- package/components/uv-empty/props.js +60 -0
- package/components/uv-empty/uv-empty.vue +126 -0
- package/components/uv-form/props.js +46 -0
- package/components/uv-form/uv-form.vue +209 -0
- package/components/uv-form/valid.js +1343 -0
- package/components/uv-form-item/props.js +49 -0
- package/components/uv-form-item/uv-form-item.vue +226 -0
- package/components/uv-gap/props.js +25 -0
- package/components/uv-gap/uv-gap.vue +36 -0
- package/components/uv-grid/props.js +20 -0
- package/components/uv-grid/uv-grid.vue +100 -0
- package/components/uv-grid-item/props.js +15 -0
- package/components/uv-grid-item/uv-grid-item.vue +223 -0
- package/components/uv-icon/icons.js +160 -0
- package/components/uv-icon/props.js +90 -0
- package/components/uv-icon/uv-icon.vue +226 -0
- package/components/uv-icon/uvicons.ttf +0 -0
- package/components/uv-image/props.js +100 -0
- package/components/uv-image/uv-image.vue +296 -0
- package/components/uv-index-anchor/props.js +30 -0
- package/components/uv-index-anchor/uv-index-anchor.vue +98 -0
- package/components/uv-index-item/uv-index-item.vue +87 -0
- package/components/uv-index-list/props.js +30 -0
- package/components/uv-index-list/uv-index-list.vue +461 -0
- package/components/uv-input/props.js +175 -0
- package/components/uv-input/uv-input.vue +348 -0
- package/components/uv-keyboard/props.js +95 -0
- package/components/uv-keyboard/uv-keyboard.vue +180 -0
- package/components/uv-keyboard-car/props.js +24 -0
- package/components/uv-keyboard-car/uv-keyboard-car.vue +347 -0
- package/components/uv-keyboard-number/props.js +19 -0
- package/components/uv-keyboard-number/uv-keyboard-number.vue +201 -0
- package/components/uv-line/props.js +34 -0
- package/components/uv-line/uv-line.vue +60 -0
- package/components/uv-line-progress/props.js +29 -0
- package/components/uv-line-progress/uv-line-progress.vue +146 -0
- package/components/uv-link/props.js +40 -0
- package/components/uv-link/uv-link.vue +83 -0
- package/components/uv-list/uv-list.vue +147 -0
- package/components/uv-list-item/uv-list-item.vue +535 -0
- package/components/uv-load-more/props.js +95 -0
- package/components/uv-load-more/uv-load-more.vue +152 -0
- package/components/uv-loading-icon/props.js +67 -0
- package/components/uv-loading-icon/uv-loading-icon.vue +347 -0
- package/components/uv-loading-page/props.js +55 -0
- package/components/uv-loading-page/uv-loading-page.vue +96 -0
- package/components/uv-modal/props.js +90 -0
- package/components/uv-modal/uv-modal.vue +245 -0
- package/components/uv-navbar/props.js +89 -0
- package/components/uv-navbar/uv-navbar.vue +245 -0
- package/components/uv-no-network/props.js +20 -0
- package/components/uv-no-network/uv-no-network.vue +222 -0
- package/components/uv-notice-bar/props.js +76 -0
- package/components/uv-notice-bar/uv-notice-bar.vue +110 -0
- package/components/uv-notify/props.js +45 -0
- package/components/uv-notify/uv-notify.vue +220 -0
- package/components/uv-number-box/props.js +118 -0
- package/components/uv-number-box/uv-number-box.vue +397 -0
- package/components/uv-overlay/props.js +25 -0
- package/components/uv-overlay/uv-overlay.vue +85 -0
- package/components/uv-parse/node/node.vue +576 -0
- package/components/uv-parse/parser.js +1335 -0
- package/components/uv-parse/uv-parse.vue +498 -0
- package/components/uv-pick-color/colors.js +217 -0
- package/components/uv-pick-color/props.js +47 -0
- package/components/uv-pick-color/uv-pick-color.vue +551 -0
- package/components/uv-picker/props.js +95 -0
- package/components/uv-picker/uv-picker.vue +329 -0
- package/components/uv-popup/keypress.js +45 -0
- package/components/uv-popup/uv-popup.vue +537 -0
- package/components/uv-preview-video/uv-preview-video.vue +52 -0
- package/components/uv-qrcode/cache.js +1 -0
- package/components/uv-qrcode/gcanvas/bridge/bridge-weex.js +241 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStyleLinearGradient.js +18 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStylePattern.js +8 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStyleRadialGradient.js +17 -0
- package/components/uv-qrcode/gcanvas/context-2d/RenderingContext.js +666 -0
- package/components/uv-qrcode/gcanvas/context-webgl/ActiveInfo.js +11 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Buffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Framebuffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLenum.js +298 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLmethod.js +142 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLtype.js +23 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Program.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Renderbuffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/RenderingContext.js +1191 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Shader.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/ShaderPrecisionFormat.js +11 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Texture.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/UniformLocation.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/classUtils.js +3 -0
- package/components/uv-qrcode/gcanvas/env/canvas.js +74 -0
- package/components/uv-qrcode/gcanvas/env/image.js +96 -0
- package/components/uv-qrcode/gcanvas/env/tool.js +24 -0
- package/components/uv-qrcode/gcanvas/index.js +39 -0
- package/components/uv-qrcode/props.js +85 -0
- package/components/uv-qrcode/qrcode.js +34 -0
- package/components/uv-qrcode/queue.js +41 -0
- package/components/uv-qrcode/uv-qrcode.vue +1038 -0
- package/components/uv-radio/props.js +65 -0
- package/components/uv-radio/uv-radio.vue +349 -0
- package/components/uv-radio-group/props.js +89 -0
- package/components/uv-radio-group/uv-radio-group.vue +115 -0
- package/components/uv-rate/props.js +73 -0
- package/components/uv-rate/uv-rate.vue +274 -0
- package/components/uv-read-more/props.js +62 -0
- package/components/uv-read-more/uv-read-more.vue +162 -0
- package/components/uv-row/props.js +20 -0
- package/components/uv-row/uv-row.vue +95 -0
- package/components/uv-row-notice/props.js +40 -0
- package/components/uv-row-notice/uv-row-notice.vue +341 -0
- package/components/uv-safe-bottom/uv-safe-bottom.vue +67 -0
- package/components/uv-scroll-list/nvue.js +29 -0
- package/components/uv-scroll-list/props.js +35 -0
- package/components/uv-scroll-list/scrollWxs.wxs +51 -0
- package/components/uv-scroll-list/uv-scroll-list.vue +218 -0
- package/components/uv-search/props.js +127 -0
- package/components/uv-search/uv-search.vue +311 -0
- package/components/uv-skeleton/props.js +65 -0
- package/components/uv-skeleton/uv-skeleton.vue +250 -0
- package/components/uv-skeletons/uv-skeletons.vue +247 -0
- package/components/uv-slider/props.js +58 -0
- package/components/uv-slider/uv-slider.vue +58 -0
- package/components/uv-status-bar/props.js +8 -0
- package/components/uv-status-bar/uv-status-bar.vue +54 -0
- package/components/uv-steps/props.js +40 -0
- package/components/uv-steps/uv-steps.vue +83 -0
- package/components/uv-steps-item/props.js +25 -0
- package/components/uv-steps-item/uv-steps-item.vue +347 -0
- package/components/uv-sticky/props.js +41 -0
- package/components/uv-sticky/uv-sticky.vue +223 -0
- package/components/uv-subsection/props.js +54 -0
- package/components/uv-subsection/uv-subsection.vue +269 -0
- package/components/uv-swipe-action/props.js +10 -0
- package/components/uv-swipe-action/uv-swipe-action.vue +65 -0
- package/components/uv-swipe-action-item/index - backup.wxs +256 -0
- package/components/uv-swipe-action-item/index.wxs +225 -0
- package/components/uv-swipe-action-item/nvue - backup.js +264 -0
- package/components/uv-swipe-action-item/nvue.js +182 -0
- package/components/uv-swipe-action-item/props.js +40 -0
- package/components/uv-swipe-action-item/uv-swipe-action-item.vue +200 -0
- package/components/uv-swipe-action-item/wxs.js +15 -0
- package/components/uv-swiper/props.js +136 -0
- package/components/uv-swiper/uv-swiper.vue +263 -0
- package/components/uv-swiper-indicator/props.js +30 -0
- package/components/uv-swiper-indicator/uv-swiper-indicator.vue +112 -0
- package/components/uv-switch/props.js +58 -0
- package/components/uv-switch/uv-switch.vue +182 -0
- package/components/uv-tabbar/props.js +50 -0
- package/components/uv-tabbar/uv-tabbar.vue +146 -0
- package/components/uv-tabbar-item/props.js +40 -0
- package/components/uv-tabbar-item/uv-tabbar-item.vue +146 -0
- package/components/uv-tabs/props.js +71 -0
- package/components/uv-tabs/uv-tabs.vue +391 -0
- package/components/uv-tags/props.js +104 -0
- package/components/uv-tags/uv-tags.vue +379 -0
- package/components/uv-text/props.js +113 -0
- package/components/uv-text/uv-text.vue +218 -0
- package/components/uv-text/value.js +87 -0
- package/components/uv-textarea/props.js +138 -0
- package/components/uv-textarea/uv-textarea.vue +238 -0
- package/components/uv-toast/uv-toast.vue +292 -0
- package/components/uv-toolbar/props.js +40 -0
- package/components/uv-toolbar/uv-toolbar.vue +109 -0
- package/components/uv-tooltip/props.js +60 -0
- package/components/uv-tooltip/uv-tooltip.vue +372 -0
- package/components/uv-transition/createAnimation.js +131 -0
- package/components/uv-transition/props.js +31 -0
- package/components/uv-transition/uv-transition.vue +320 -0
- package/components/uv-upload/mixin.js +22 -0
- package/components/uv-upload/props.js +130 -0
- package/components/uv-upload/utils.js +151 -0
- package/components/uv-upload/uv-upload.vue +488 -0
- package/components/uv-vtabs/props.js +79 -0
- package/components/uv-vtabs/uv-vtabs.vue +438 -0
- package/components/uv-vtabs-item/uv-vtabs-item.vue +68 -0
- package/components/uv-waterfall/props.js +69 -0
- package/components/uv-waterfall/uv-waterfall.vue +265 -0
- package/index.js +82 -0
- package/index.scss +7 -0
- package/libs/config/config.js +34 -0
- package/libs/css/color.scss +32 -0
- package/libs/css/common.scss +100 -0
- package/libs/css/components.scss +23 -0
- package/libs/css/variable.scss +111 -0
- package/libs/css/vue.scss +40 -0
- package/libs/function/colorGradient.js +134 -0
- package/libs/function/compress.js +27 -0
- package/libs/function/debounce.js +29 -0
- package/libs/function/digit.js +167 -0
- package/libs/function/index.js +734 -0
- package/libs/function/platform.js +75 -0
- package/libs/function/test.js +287 -0
- package/libs/function/throttle.js +30 -0
- package/libs/luch-request/adapters/index.js +132 -0
- package/libs/luch-request/core/InterceptorManager.js +51 -0
- package/libs/luch-request/core/Request.js +201 -0
- package/libs/luch-request/core/buildFullPath.js +20 -0
- package/libs/luch-request/core/defaults.js +33 -0
- package/libs/luch-request/core/dispatchRequest.js +6 -0
- package/libs/luch-request/core/mergeConfig.js +126 -0
- package/libs/luch-request/core/settle.js +16 -0
- package/libs/luch-request/helpers/buildURL.js +64 -0
- package/libs/luch-request/helpers/combineURLs.js +14 -0
- package/libs/luch-request/helpers/isAbsoluteURL.js +14 -0
- package/libs/luch-request/index.d.ts +197 -0
- package/libs/luch-request/index.js +2 -0
- package/libs/luch-request/utils/clone.js +264 -0
- package/libs/luch-request/utils.js +135 -0
- package/libs/mixin/button.js +13 -0
- package/libs/mixin/mixin.js +172 -0
- package/libs/mixin/mpMixin.js +8 -0
- package/libs/mixin/mpShare.js +13 -0
- package/libs/mixin/openType.js +47 -0
- package/libs/mixin/touch.js +59 -0
- package/libs/util/dayjs.js +216 -0
- package/libs/util/route.js +126 -0
- package/package.json +28 -0
- package/theme.scss +43 -0
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @1900-2100区间内的公历、农历互转
|
|
3
|
+
* @charset UTF-8
|
|
4
|
+
* @github https://github.com/jjonline/calendar.js
|
|
5
|
+
* @Author Jea杨(JJonline@JJonline.Cn)
|
|
6
|
+
* @Time 2014-7-21
|
|
7
|
+
* @Time 2016-8-13 Fixed 2033hex、Attribution Annals
|
|
8
|
+
* @Time 2016-9-25 Fixed lunar LeapMonth Param Bug
|
|
9
|
+
* @Time 2017-7-24 Fixed use getTerm Func Param Error.use solar year,NOT lunar year
|
|
10
|
+
* @Version 1.0.3
|
|
11
|
+
* @公历转农历:calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]
|
|
12
|
+
* @农历转公历:calendar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0]
|
|
13
|
+
*/
|
|
14
|
+
/* eslint-disable */
|
|
15
|
+
var calendar = {
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 农历1900-2100的润大小信息表
|
|
19
|
+
* @Array Of Property
|
|
20
|
+
* @return Hex
|
|
21
|
+
*/
|
|
22
|
+
lunarInfo: [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, // 1900-1909
|
|
23
|
+
0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, // 1910-1919
|
|
24
|
+
0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, // 1920-1929
|
|
25
|
+
0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, // 1930-1939
|
|
26
|
+
0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, // 1940-1949
|
|
27
|
+
0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, // 1950-1959
|
|
28
|
+
0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, // 1960-1969
|
|
29
|
+
0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, // 1970-1979
|
|
30
|
+
0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, // 1980-1989
|
|
31
|
+
0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0, // 1990-1999
|
|
32
|
+
0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, // 2000-2009
|
|
33
|
+
0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, // 2010-2019
|
|
34
|
+
0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, // 2020-2029
|
|
35
|
+
0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, // 2030-2039
|
|
36
|
+
0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, // 2040-2049
|
|
37
|
+
/** Add By JJonline@JJonline.Cn**/
|
|
38
|
+
0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, // 2050-2059
|
|
39
|
+
0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, // 2060-2069
|
|
40
|
+
0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, // 2070-2079
|
|
41
|
+
0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, // 2080-2089
|
|
42
|
+
0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, // 2090-2099
|
|
43
|
+
0x0d520], // 2100
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 公历每个月份的天数普通表
|
|
47
|
+
* @Array Of Property
|
|
48
|
+
* @return Number
|
|
49
|
+
*/
|
|
50
|
+
solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 天干地支之天干速查表
|
|
54
|
+
* @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]
|
|
55
|
+
* @return Cn string
|
|
56
|
+
*/
|
|
57
|
+
Gan: ['\u7532', '\u4e59', '\u4e19', '\u4e01', '\u620a', '\u5df1', '\u5e9a', '\u8f9b', '\u58ec', '\u7678'],
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 天干地支之地支速查表
|
|
61
|
+
* @Array Of Property
|
|
62
|
+
* @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
|
|
63
|
+
* @return Cn string
|
|
64
|
+
*/
|
|
65
|
+
Zhi: ['\u5b50', '\u4e11', '\u5bc5', '\u536f', '\u8fb0', '\u5df3', '\u5348', '\u672a', '\u7533', '\u9149', '\u620c', '\u4ea5'],
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 天干地支之地支速查表<=>生肖
|
|
69
|
+
* @Array Of Property
|
|
70
|
+
* @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
|
|
71
|
+
* @return Cn string
|
|
72
|
+
*/
|
|
73
|
+
Animals: ['\u9f20', '\u725b', '\u864e', '\u5154', '\u9f99', '\u86c7', '\u9a6c', '\u7f8a', '\u7334', '\u9e21', '\u72d7', '\u732a'],
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 24节气速查表
|
|
77
|
+
* @Array Of Property
|
|
78
|
+
* @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]
|
|
79
|
+
* @return Cn string
|
|
80
|
+
*/
|
|
81
|
+
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'],
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 1900-2100各年的24节气日期速查表
|
|
85
|
+
* @Array Of Property
|
|
86
|
+
* @return 0x string For splice
|
|
87
|
+
*/
|
|
88
|
+
sTermInfo: ['9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f',
|
|
89
|
+
'97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
|
90
|
+
'97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa',
|
|
91
|
+
'97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f',
|
|
92
|
+
'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f',
|
|
93
|
+
'97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa',
|
|
94
|
+
'97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2',
|
|
95
|
+
'9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f',
|
|
96
|
+
'97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
|
97
|
+
'97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
|
98
|
+
'97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722',
|
|
99
|
+
'9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f',
|
|
100
|
+
'97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
|
101
|
+
'97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
|
102
|
+
'97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722',
|
|
103
|
+
'9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f',
|
|
104
|
+
'97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
|
|
105
|
+
'97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
|
|
106
|
+
'9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722',
|
|
107
|
+
'7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
|
108
|
+
'97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
|
109
|
+
'97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
|
|
110
|
+
'9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722',
|
|
111
|
+
'7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
|
|
112
|
+
'97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
|
113
|
+
'97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
|
|
114
|
+
'9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722',
|
|
115
|
+
'7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
|
|
116
|
+
'97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
|
|
117
|
+
'9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
|
|
118
|
+
'7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
|
|
119
|
+
'7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
|
120
|
+
'97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
|
|
121
|
+
'9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
|
|
122
|
+
'7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
|
|
123
|
+
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
|
|
124
|
+
'97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
|
|
125
|
+
'9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
|
|
126
|
+
'7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721',
|
|
127
|
+
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2',
|
|
128
|
+
'977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
|
|
129
|
+
'7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
|
130
|
+
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd',
|
|
131
|
+
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
|
|
132
|
+
'977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
|
|
133
|
+
'7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
|
134
|
+
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd',
|
|
135
|
+
'7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
|
|
136
|
+
'977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
|
|
137
|
+
'7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721',
|
|
138
|
+
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5',
|
|
139
|
+
'7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722',
|
|
140
|
+
'7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
|
141
|
+
'7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
|
|
142
|
+
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35',
|
|
143
|
+
'7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
|
|
144
|
+
'7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721',
|
|
145
|
+
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd',
|
|
146
|
+
'7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35',
|
|
147
|
+
'7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
|
|
148
|
+
'7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721',
|
|
149
|
+
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5',
|
|
150
|
+
'7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35',
|
|
151
|
+
'665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
|
|
152
|
+
'7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
|
|
153
|
+
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35',
|
|
154
|
+
'7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722'],
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* 数字转中文速查表
|
|
158
|
+
* @Array Of Property
|
|
159
|
+
* @trans ['日','一','二','三','四','五','六','七','八','九','十']
|
|
160
|
+
* @return Cn string
|
|
161
|
+
*/
|
|
162
|
+
nStr1: ['\u65e5', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341'],
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* 日期转农历称呼速查表
|
|
166
|
+
* @Array Of Property
|
|
167
|
+
* @trans ['初','十','廿','卅']
|
|
168
|
+
* @return Cn string
|
|
169
|
+
*/
|
|
170
|
+
nStr2: ['\u521d', '\u5341', '\u5eff', '\u5345'],
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 月份转农历称呼速查表
|
|
174
|
+
* @Array Of Property
|
|
175
|
+
* @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
|
|
176
|
+
* @return Cn string
|
|
177
|
+
*/
|
|
178
|
+
nStr3: ['\u6b63', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341', '\u51ac', '\u814a'],
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* 返回农历y年一整年的总天数
|
|
182
|
+
* @param lunar Year
|
|
183
|
+
* @return Number
|
|
184
|
+
* @eg:var count = calendar.lYearDays(1987) ;//count=387
|
|
185
|
+
*/
|
|
186
|
+
lYearDays: function (y) {
|
|
187
|
+
var i; var sum = 348
|
|
188
|
+
for (i = 0x8000; i > 0x8; i >>= 1) { sum += (this.lunarInfo[y - 1900] & i) ? 1 : 0 }
|
|
189
|
+
return (sum + this.leapDays(y))
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
|
|
194
|
+
* @param lunar Year
|
|
195
|
+
* @return Number (0-12)
|
|
196
|
+
* @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
|
|
197
|
+
*/
|
|
198
|
+
leapMonth: function (y) { // 闰字编码 \u95f0
|
|
199
|
+
return (this.lunarInfo[y - 1900] & 0xf)
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* 返回农历y年闰月的天数 若该年没有闰月则返回0
|
|
204
|
+
* @param lunar Year
|
|
205
|
+
* @return Number (0、29、30)
|
|
206
|
+
* @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
|
|
207
|
+
*/
|
|
208
|
+
leapDays: function (y) {
|
|
209
|
+
if (this.leapMonth(y)) {
|
|
210
|
+
return ((this.lunarInfo[y - 1900] & 0x10000) ? 30 : 29)
|
|
211
|
+
}
|
|
212
|
+
return (0)
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
|
|
217
|
+
* @param lunar Year
|
|
218
|
+
* @return Number (-1、29、30)
|
|
219
|
+
* @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
|
|
220
|
+
*/
|
|
221
|
+
monthDays: function (y, m) {
|
|
222
|
+
if (m > 12 || m < 1) { return -1 }// 月份参数从1至12,参数错误返回-1
|
|
223
|
+
return ((this.lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29)
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* 返回公历(!)y年m月的天数
|
|
228
|
+
* @param solar Year
|
|
229
|
+
* @return Number (-1、28、29、30、31)
|
|
230
|
+
* @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
|
|
231
|
+
*/
|
|
232
|
+
solarDays: function (y, m) {
|
|
233
|
+
if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1
|
|
234
|
+
var ms = m - 1
|
|
235
|
+
if (ms == 1) { // 2月份的闰平规律测算后确认返回28或29
|
|
236
|
+
return (((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) ? 29 : 28)
|
|
237
|
+
} else {
|
|
238
|
+
return (this.solarMonth[ms])
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* 农历年份转换为干支纪年
|
|
244
|
+
* @param lYear 农历年的年份数
|
|
245
|
+
* @return Cn string
|
|
246
|
+
*/
|
|
247
|
+
toGanZhiYear: function (lYear) {
|
|
248
|
+
var ganKey = (lYear - 3) % 10
|
|
249
|
+
var zhiKey = (lYear - 3) % 12
|
|
250
|
+
if (ganKey == 0) ganKey = 10// 如果余数为0则为最后一个天干
|
|
251
|
+
if (zhiKey == 0) zhiKey = 12// 如果余数为0则为最后一个地支
|
|
252
|
+
return this.Gan[ganKey - 1] + this.Zhi[zhiKey - 1]
|
|
253
|
+
},
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* 公历月、日判断所属星座
|
|
257
|
+
* @param cMonth [description]
|
|
258
|
+
* @param cDay [description]
|
|
259
|
+
* @return Cn string
|
|
260
|
+
*/
|
|
261
|
+
toAstro: function (cMonth, cDay) {
|
|
262
|
+
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'
|
|
263
|
+
var arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22]
|
|
264
|
+
return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + '\u5ea7'// 座
|
|
265
|
+
},
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* 传入offset偏移量返回干支
|
|
269
|
+
* @param offset 相对甲子的偏移量
|
|
270
|
+
* @return Cn string
|
|
271
|
+
*/
|
|
272
|
+
toGanZhi: function (offset) {
|
|
273
|
+
return this.Gan[offset % 10] + this.Zhi[offset % 12]
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* 传入公历(!)y年获得该年第n个节气的公历日期
|
|
278
|
+
* @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
|
|
279
|
+
* @return day Number
|
|
280
|
+
* @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
|
|
281
|
+
*/
|
|
282
|
+
getTerm: function (y, n) {
|
|
283
|
+
if (y < 1900 || y > 2100) { return -1 }
|
|
284
|
+
if (n < 1 || n > 24) { return -1 }
|
|
285
|
+
var _table = this.sTermInfo[y - 1900]
|
|
286
|
+
var _info = [
|
|
287
|
+
parseInt('0x' + _table.substr(0, 5)).toString(),
|
|
288
|
+
parseInt('0x' + _table.substr(5, 5)).toString(),
|
|
289
|
+
parseInt('0x' + _table.substr(10, 5)).toString(),
|
|
290
|
+
parseInt('0x' + _table.substr(15, 5)).toString(),
|
|
291
|
+
parseInt('0x' + _table.substr(20, 5)).toString(),
|
|
292
|
+
parseInt('0x' + _table.substr(25, 5)).toString()
|
|
293
|
+
]
|
|
294
|
+
var _calday = [
|
|
295
|
+
_info[0].substr(0, 1),
|
|
296
|
+
_info[0].substr(1, 2),
|
|
297
|
+
_info[0].substr(3, 1),
|
|
298
|
+
_info[0].substr(4, 2),
|
|
299
|
+
|
|
300
|
+
_info[1].substr(0, 1),
|
|
301
|
+
_info[1].substr(1, 2),
|
|
302
|
+
_info[1].substr(3, 1),
|
|
303
|
+
_info[1].substr(4, 2),
|
|
304
|
+
|
|
305
|
+
_info[2].substr(0, 1),
|
|
306
|
+
_info[2].substr(1, 2),
|
|
307
|
+
_info[2].substr(3, 1),
|
|
308
|
+
_info[2].substr(4, 2),
|
|
309
|
+
|
|
310
|
+
_info[3].substr(0, 1),
|
|
311
|
+
_info[3].substr(1, 2),
|
|
312
|
+
_info[3].substr(3, 1),
|
|
313
|
+
_info[3].substr(4, 2),
|
|
314
|
+
|
|
315
|
+
_info[4].substr(0, 1),
|
|
316
|
+
_info[4].substr(1, 2),
|
|
317
|
+
_info[4].substr(3, 1),
|
|
318
|
+
_info[4].substr(4, 2),
|
|
319
|
+
|
|
320
|
+
_info[5].substr(0, 1),
|
|
321
|
+
_info[5].substr(1, 2),
|
|
322
|
+
_info[5].substr(3, 1),
|
|
323
|
+
_info[5].substr(4, 2)
|
|
324
|
+
]
|
|
325
|
+
return parseInt(_calday[n - 1])
|
|
326
|
+
},
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* 传入农历数字月份返回汉语通俗表示法
|
|
330
|
+
* @param lunar month
|
|
331
|
+
* @return Cn string
|
|
332
|
+
* @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
|
|
333
|
+
*/
|
|
334
|
+
toChinaMonth: function (m) { // 月 => \u6708
|
|
335
|
+
if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1
|
|
336
|
+
var s = this.nStr3[m - 1]
|
|
337
|
+
s += '\u6708'// 加上月字
|
|
338
|
+
return s
|
|
339
|
+
},
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* 传入农历日期数字返回汉字表示法
|
|
343
|
+
* @param lunar day
|
|
344
|
+
* @return Cn string
|
|
345
|
+
* @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
|
|
346
|
+
*/
|
|
347
|
+
toChinaDay: function (d) { // 日 => \u65e5
|
|
348
|
+
var s
|
|
349
|
+
switch (d) {
|
|
350
|
+
case 10:
|
|
351
|
+
s = '\u521d\u5341'; break
|
|
352
|
+
case 20:
|
|
353
|
+
s = '\u4e8c\u5341'; break
|
|
354
|
+
break
|
|
355
|
+
case 30:
|
|
356
|
+
s = '\u4e09\u5341'; break
|
|
357
|
+
break
|
|
358
|
+
default :
|
|
359
|
+
s = this.nStr2[Math.floor(d / 10)]
|
|
360
|
+
s += this.nStr1[d % 10]
|
|
361
|
+
}
|
|
362
|
+
return (s)
|
|
363
|
+
},
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
|
|
367
|
+
* @param y year
|
|
368
|
+
* @return Cn string
|
|
369
|
+
* @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
|
|
370
|
+
*/
|
|
371
|
+
getAnimal: function (y) {
|
|
372
|
+
return this.Animals[(y - 4) % 12]
|
|
373
|
+
},
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
|
|
377
|
+
* @param y solar year
|
|
378
|
+
* @param m solar month
|
|
379
|
+
* @param d solar day
|
|
380
|
+
* @return JSON object
|
|
381
|
+
* @eg:console.log(calendar.solar2lunar(1987,11,01));
|
|
382
|
+
*/
|
|
383
|
+
solar2lunar: function (y, m, d) { // 参数区间1900.1.31~2100.12.31
|
|
384
|
+
// 年份限定、上限
|
|
385
|
+
if (y < 1900 || y > 2100) {
|
|
386
|
+
return -1// undefined转换为数字变为NaN
|
|
387
|
+
}
|
|
388
|
+
// 公历传参最下限
|
|
389
|
+
if (y == 1900 && m == 1 && d < 31) {
|
|
390
|
+
return -1
|
|
391
|
+
}
|
|
392
|
+
// 未传参 获得当天
|
|
393
|
+
if (!y) {
|
|
394
|
+
var objDate = new Date()
|
|
395
|
+
} else {
|
|
396
|
+
var objDate = new Date(y, parseInt(m) - 1, d)
|
|
397
|
+
}
|
|
398
|
+
var i; var leap = 0; var temp = 0
|
|
399
|
+
// 修正ymd参数
|
|
400
|
+
var y = objDate.getFullYear()
|
|
401
|
+
var m = objDate.getMonth() + 1
|
|
402
|
+
var d = objDate.getDate()
|
|
403
|
+
var offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / 86400000
|
|
404
|
+
for (i = 1900; i < 2101 && offset > 0; i++) {
|
|
405
|
+
temp = this.lYearDays(i)
|
|
406
|
+
offset -= temp
|
|
407
|
+
}
|
|
408
|
+
if (offset < 0) {
|
|
409
|
+
offset += temp; i--
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// 是否今天
|
|
413
|
+
var isTodayObj = new Date()
|
|
414
|
+
var isToday = false
|
|
415
|
+
if (isTodayObj.getFullYear() == y && isTodayObj.getMonth() + 1 == m && isTodayObj.getDate() == d) {
|
|
416
|
+
isToday = true
|
|
417
|
+
}
|
|
418
|
+
// 星期几
|
|
419
|
+
var nWeek = objDate.getDay()
|
|
420
|
+
var cWeek = this.nStr1[nWeek]
|
|
421
|
+
// 数字表示周几顺应天朝周一开始的惯例
|
|
422
|
+
if (nWeek == 0) {
|
|
423
|
+
nWeek = 7
|
|
424
|
+
}
|
|
425
|
+
// 农历年
|
|
426
|
+
var year = i
|
|
427
|
+
var leap = this.leapMonth(i) // 闰哪个月
|
|
428
|
+
var isLeap = false
|
|
429
|
+
|
|
430
|
+
// 效验闰月
|
|
431
|
+
for (i = 1; i < 13 && offset > 0; i++) {
|
|
432
|
+
// 闰月
|
|
433
|
+
if (leap > 0 && i == (leap + 1) && isLeap == false) {
|
|
434
|
+
--i
|
|
435
|
+
isLeap = true; temp = this.leapDays(year) // 计算农历闰月天数
|
|
436
|
+
} else {
|
|
437
|
+
temp = this.monthDays(year, i)// 计算农历普通月天数
|
|
438
|
+
}
|
|
439
|
+
// 解除闰月
|
|
440
|
+
if (isLeap == true && i == (leap + 1)) { isLeap = false }
|
|
441
|
+
offset -= temp
|
|
442
|
+
}
|
|
443
|
+
// 闰月导致数组下标重叠取反
|
|
444
|
+
if (offset == 0 && leap > 0 && i == leap + 1) {
|
|
445
|
+
if (isLeap) {
|
|
446
|
+
isLeap = false
|
|
447
|
+
} else {
|
|
448
|
+
isLeap = true; --i
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
if (offset < 0) {
|
|
452
|
+
offset += temp; --i
|
|
453
|
+
}
|
|
454
|
+
// 农历月
|
|
455
|
+
var month = i
|
|
456
|
+
// 农历日
|
|
457
|
+
var day = offset + 1
|
|
458
|
+
// 天干地支处理
|
|
459
|
+
var sm = m - 1
|
|
460
|
+
var gzY = this.toGanZhiYear(year)
|
|
461
|
+
|
|
462
|
+
// 当月的两个节气
|
|
463
|
+
// bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year`
|
|
464
|
+
var firstNode = this.getTerm(y, (m * 2 - 1))// 返回当月「节」为几日开始
|
|
465
|
+
var secondNode = this.getTerm(y, (m * 2))// 返回当月「节」为几日开始
|
|
466
|
+
|
|
467
|
+
// 依据12节气修正干支月
|
|
468
|
+
var gzM = this.toGanZhi((y - 1900) * 12 + m + 11)
|
|
469
|
+
if (d >= firstNode) {
|
|
470
|
+
gzM = this.toGanZhi((y - 1900) * 12 + m + 12)
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// 传入的日期的节气与否
|
|
474
|
+
var isTerm = false
|
|
475
|
+
var Term = null
|
|
476
|
+
if (firstNode == d) {
|
|
477
|
+
isTerm = true
|
|
478
|
+
Term = this.solarTerm[m * 2 - 2]
|
|
479
|
+
}
|
|
480
|
+
if (secondNode == d) {
|
|
481
|
+
isTerm = true
|
|
482
|
+
Term = this.solarTerm[m * 2 - 1]
|
|
483
|
+
}
|
|
484
|
+
// 日柱 当月一日与 1900/1/1 相差天数
|
|
485
|
+
var dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10
|
|
486
|
+
var gzD = this.toGanZhi(dayCyclical + d - 1)
|
|
487
|
+
// 该日期所属的星座
|
|
488
|
+
var astro = this.toAstro(m, d)
|
|
489
|
+
|
|
490
|
+
return { '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 }
|
|
491
|
+
},
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
|
|
495
|
+
* @param y lunar year
|
|
496
|
+
* @param m lunar month
|
|
497
|
+
* @param d lunar day
|
|
498
|
+
* @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
|
|
499
|
+
* @return JSON object
|
|
500
|
+
* @eg:console.log(calendar.lunar2solar(1987,9,10));
|
|
501
|
+
*/
|
|
502
|
+
lunar2solar: function (y, m, d, isLeapMonth) { // 参数区间1900.1.31~2100.12.1
|
|
503
|
+
var isLeapMonth = !!isLeapMonth
|
|
504
|
+
var leapOffset = 0
|
|
505
|
+
var leapMonth = this.leapMonth(y)
|
|
506
|
+
var leapDay = this.leapDays(y)
|
|
507
|
+
if (isLeapMonth && (leapMonth != m)) { return -1 }// 传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
|
|
508
|
+
if (y == 2100 && m == 12 && d > 1 || y == 1900 && m == 1 && d < 31) { return -1 }// 超出了最大极限值
|
|
509
|
+
var day = this.monthDays(y, m)
|
|
510
|
+
var _day = day
|
|
511
|
+
// bugFix 2016-9-25
|
|
512
|
+
// if month is leap, _day use leapDays method
|
|
513
|
+
if (isLeapMonth) {
|
|
514
|
+
_day = this.leapDays(y, m)
|
|
515
|
+
}
|
|
516
|
+
if (y < 1900 || y > 2100 || d > _day) { return -1 }// 参数合法性效验
|
|
517
|
+
|
|
518
|
+
// 计算农历的时间差
|
|
519
|
+
var offset = 0
|
|
520
|
+
for (var i = 1900; i < y; i++) {
|
|
521
|
+
offset += this.lYearDays(i)
|
|
522
|
+
}
|
|
523
|
+
var leap = 0; var isAdd = false
|
|
524
|
+
for (var i = 1; i < m; i++) {
|
|
525
|
+
leap = this.leapMonth(y)
|
|
526
|
+
if (!isAdd) { // 处理闰月
|
|
527
|
+
if (leap <= i && leap > 0) {
|
|
528
|
+
offset += this.leapDays(y); isAdd = true
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
offset += this.monthDays(y, i)
|
|
532
|
+
}
|
|
533
|
+
// 转换闰月农历 需补充该年闰月的前一个月的时差
|
|
534
|
+
if (isLeapMonth) { offset += day }
|
|
535
|
+
// 1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
|
|
536
|
+
var stmap = Date.UTC(1900, 1, 30, 0, 0, 0)
|
|
537
|
+
var calObj = new Date((offset + d - 31) * 86400000 + stmap)
|
|
538
|
+
var cY = calObj.getUTCFullYear()
|
|
539
|
+
var cM = calObj.getUTCMonth() + 1
|
|
540
|
+
var cD = calObj.getUTCDate()
|
|
541
|
+
|
|
542
|
+
return this.solar2lunar(cY, cM, cD)
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
export default calendar
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uv-calender.ok": "ok",
|
|
3
|
+
"uv-calender.cancel": "cancel",
|
|
4
|
+
"uv-calender.today": "today",
|
|
5
|
+
"uv-calender.MON": "MON",
|
|
6
|
+
"uv-calender.TUE": "TUE",
|
|
7
|
+
"uv-calender.WED": "WED",
|
|
8
|
+
"uv-calender.THU": "THU",
|
|
9
|
+
"uv-calender.FRI": "FRI",
|
|
10
|
+
"uv-calender.SAT": "SAT",
|
|
11
|
+
"uv-calender.SUN": "SUN"
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uv-calender.ok": "确定",
|
|
3
|
+
"uv-calender.cancel": "取消",
|
|
4
|
+
"uv-calender.today": "今日",
|
|
5
|
+
"uv-calender.SUN": "日",
|
|
6
|
+
"uv-calender.MON": "一",
|
|
7
|
+
"uv-calender.TUE": "二",
|
|
8
|
+
"uv-calender.WED": "三",
|
|
9
|
+
"uv-calender.THU": "四",
|
|
10
|
+
"uv-calender.FRI": "五",
|
|
11
|
+
"uv-calender.SAT": "六"
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uv-calender.ok": "確定",
|
|
3
|
+
"uv-calender.cancel": "取消",
|
|
4
|
+
"uv-calender.today": "今日",
|
|
5
|
+
"uv-calender.SUN": "日",
|
|
6
|
+
"uv-calender.MON": "一",
|
|
7
|
+
"uv-calender.TUE": "二",
|
|
8
|
+
"uv-calender.WED": "三",
|
|
9
|
+
"uv-calender.THU": "四",
|
|
10
|
+
"uv-calender.FRI": "五",
|
|
11
|
+
"uv-calender.SAT": "六"
|
|
12
|
+
}
|