colorful-festival-ljq
v1.1.1
Published
PKUOSS class assignment
Downloads
13
Readme
osspku-ColorfulFestival_LJQ
Set_Favorite_Festival(str): 将输入字符串所代表的节日,标记为用户喜爱的节日
Get_Favorite_Festival(): 输出所有用户标记为喜爱的节日信息
Cancel_Favorite_Festival(str): 将输入字符串所代表的节日,不再标记为用户喜爱的节日
Year_Festivals(int): 给定年份,按照日期的时间顺序,输出该年份所有的节假日日及其日期。并且,将用户喜爱的节日用青色(cyan)字符串输出;中国传统节日及其日期用红色字符串输出;外国传统节日及其日期用蓝色字符串输出;创建时间在1900年以后的新兴节日,如护士节等,用默认颜色字符串输出即可。如果节日符合多种条件使字符串颜色有潜在冲突,则更早声明的规则优先级更高。节日的范围采用lunarcalendar.festival模块中的范围即可,不必添加更多
Next_Festivals(str): 给定字符串格式的日期,要求支持至少三种日期格式"YYYYMMDD"、"YYYY/MM/DD"、"YYYY-MM-DD"、"YYYY年M月D日"(可以考虑使用date-string包处理输入)。输出在此日之后、并且日期最接近此日的10个节日名称及其日期。字符串输出要求参考Year_Festivals
usage:
import cf from 'colorful-festival-ljq'
//replace 'cf' to anything you like
cf.Year_Festivals(2019);
cf.Next_Festivals("20190105");