Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加时间戳功能 #93

Open
yyccQQu opened this issue May 28, 2019 · 0 comments
Open

添加时间戳功能 #93

yyccQQu opened this issue May 28, 2019 · 0 comments

Comments

@yyccQQu
Copy link

yyccQQu commented May 28, 2019

// 时间戳转换为时间
window.makeTimes = function (value) {
    var str = Math.round(parseInt((new Date(value)).valueOf()) / 1000);
    if (isNaN(str)) {
        str = 0
    }
    return str
}
//获取年月日星期 时间戳
    jeDate.getLunar = function(obj){
        //如果为数字类型的日期对获取到日期的进行替换
        var lunars = jeLunar(obj.YYYY, parseInt(obj.MM) - 1, obj.DD);
        return{
            nM: lunars.lnongMonth,              //农历月
            nD: lunars.lnongDate,               //农历日
            cY: parseInt(lunars.solarYear),     //阳历年
            cM: parseInt(lunars.solarMonth),    //阳历月
            cD: parseInt(lunars.solarDate),     //阳历日
            cW: lunars.inWeekDays,              //汉字星期几
            nW: lunars.solarWeekDay,             //数字星期几
            timeStamp: window.makeTimes(obj.val)
        };
    };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant