1.1.22 • Published 1 year ago

my-lunar-calendar v1.1.22

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Lunar Calendar

This is for Vue.

For React version please go to lunar-calendar-react.

Supports both solar and lunar calendar displaying.

Displaying events is supported.

Please see the configurations below.

Configurations

NameData TypeDefaultDescriptionExample
wrapperStylesObject{}Root element styles{ paddingTop: '10px' }
rowStylesObject{}Row styles{ paddingTop: '10px' }
cellStylesObject{}Cell styles{ paddingTop: '10px' }
lunarTextStylesObject{}Lunar text styles{ paddingTop: '10px' }
toolbarStylesObject{}Toolbar styles{ paddingTop: '10px' }
selectedCellStylesObject{}Selected date styles{ backgroundColor: 'blue' }
hideToolbarBooleanfalseIf true will hide toolbartrue
autoHideToolbarBooleanfalseIf true only show toolbar when mouse hover on it. The layout won't change, use css visibilitytrue
showLunarBooleanfalseIf true will show lunar date and termtrue
alwaysShowBooleanfalseIt's suitable for read mode or put it anywhere for customizationtrue
showWeeksInEnBooleanfalseShow weeks in Englishtrue
showTimeBooleanfalseShow both date and time, only show hours and minutes by defaulttrue
showSecondsBooleanfalseShow secondstrue
noBgBooleanfalseIf true the background will be transparent without bordertrue
selectedDateDatenowCurrent datenew Date()
lunarSameRowBooleanfalseIf true will put solar and lunar text in the same rowtrue
showEventsBooleantrueIf no events, then no difference with falsefalse
showEventsOnlyCountBooleanfalseOnly show event numberstrue
eventStylesObject{}Set maxWidth, etc{ maxWidth: '40px'}
eventCountStylesObject{}Event numbers style{ width: '20px', color: 'blue'}
eventsObject Array[]Events array, name is required. Any other properties are accepted[{ date: '2023-11-01', events: { name: 'Happy New Year' }, { name: 'Birthday' }},]

event: selectDate(data, e), result as below

Data

{
    "year": 2023,
    "month": 11,
    "date": 16,
    "lunarYear": 2023,
    "lunarMonth": "十月",
    "lunarDate": "初四",
    "lunarWeek": "星期四",
    "animal": "兔",
    "gzDay": "戊寅",
    "gzMonth": "癸亥",
    "gzYear": "癸卯",
    "isLeap": false,
    "week": 4,
    "term": null,
    "fullDate": "2023-11-16"
    "hour": 18,
    "minute": 6,
    "second": 25,
    "fullTime": "18:06:25",
    "fullDateTime": "2023-11-16 18:06:25"
}

Event

Event object

event: selectEvent(eventData, dateData, e), result as below

Event data

{ "name": "Happy New Year" }

Date data

{
  "year": 2023,
  "month": 11,
  "date": 1,
  "label": 1,
  "lunarDate": "十八",
  "events": [{ "name": "Happy New Year" }, { "name": "Birthday" }],
  "term": null,
  "fullDate": "2023-11-01"
}

Click event

Event object

event: selectEventCount(dateData, e), result as below

Date data

{
  "year": 2023,
  "month": 11,
  "date": 1,
  "label": 1,
  "lunarDate": "十八",
  "events": [{ "name": "Happy New Year" }, { "name": "Birthday" }],
  "term": null,
  "fullDate": "2023-11-01"
}

Click event

Event object

usages

Import css and component anywhere you need

import 'my-lunar-calendar/style.css';
import { LunarCalendar } from 'my-lunar-calendar';

Use it in the html part

<LunarCalendar :showLunar="true">
    <template v-slot:default="{ onTrigger }">
        <span @click="onTrigger">Some text</span>
    </template>
</LunarCalendar>
<LunarCalendar
    @selectDate="onSelectDate(data, event)"
    :alwaysShow="true"
    :noBg="true"
    :autoHideToolbar="true"
    :wrapperStyles="{ color: '#fff' }"
/>

Examples

Wrapped by custom element without bg

Wrapped by custom element without bg

Lunar calendar

Lunar calendar

Show weeks in English

Show weeks in English

Show time

Show weeks in English

Select year panel

Select year panel

Lunar same row

Lunar same row

Event count

Event count

Event count tooltip

Event count tooltip

Event text

Event text

Event text tooltip

Event text tooltip

Support

For customizations, please send email to 442875974@qq.com.

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago