正在显示
1 个修改的文件
包含
23 行增加
和
12 行删除
@@ -553,21 +553,32 @@ Page({ | @@ -553,21 +553,32 @@ Page({ | ||
553 | 553 | ||
554 | var birthday='1995-04-20' | 554 | var birthday='1995-04-20' |
555 | var birthday_year = parseInt(new Date(birthday).getFullYear()) | 555 | var birthday_year = parseInt(new Date(birthday).getFullYear()) |
556 | + var tempbirth_time='' | ||
556 | 557 | ||
557 | if (unit == '年') { | 558 | if (unit == '年') { |
558 | - runnian = parseInt(time_name / 4) | ||
559 | - cha = time_name - runnian | ||
560 | - var dateTemp = compact_time.split("-"); | ||
561 | - var nDate = new Date(dateTemp[1] + '-' + dateTemp[2] + '-' + dateTemp[0]); | ||
562 | - var millSeconds = Math.abs(nDate) + (((cha * 365) + (runnian*366) )* 24 * 60 * 60 * 1000) - (1 * 24 * 60 * 60 * 1000); | ||
563 | - var rDate = new Date(millSeconds); | ||
564 | - var year = rDate.getFullYear(); | ||
565 | - var month = rDate.getMonth() + 1; | ||
566 | - if (month < 10) month = "0" + month; | ||
567 | - var date = rDate.getDate(); | ||
568 | - if (date < 10) date = "0" + date; | ||
569 | - console.log(year + "-" + month + "-" + date); | 559 | + |
560 | + var millSeconds = Math.abs(nDate) - (1 * 24 * 60 * 60 * 1000); | ||
561 | + | ||
562 | + // runnian = parseInt(time_name / 4) | ||
563 | + // cha = time_name - runnian | ||
564 | + // var dateTemp = compact_time.split("-"); | ||
565 | + // var nDate = new Date(dateTemp[1] + '-' + dateTemp[2] + '-' + dateTemp[0]); | ||
566 | + // var millSeconds = Math.abs(nDate) + (((cha * 365) + (runnian*366) )* 24 * 60 * 60 * 1000) - (1 * 24 * 60 * 60 * 1000); | ||
567 | + // var rDate = new Date(millSeconds); | ||
568 | + // var year = rDate.getFullYear(); | ||
569 | + // var month = rDate.getMonth() + 1; | ||
570 | + | ||
571 | + // if (month < 10) month = "0" + month; | ||
572 | + // var date = rDate.getDate(); | ||
573 | + // if (date < 10) date = "0" + date; | ||
574 | + // console.log(year + "-" + month + "-" + date); | ||
575 | + | ||
570 | }else if(unit=='岁'){ | 576 | }else if(unit=='岁'){ |
577 | + var temp_year = (birthday_year + time_name - 1) | ||
578 | + var temp_month = month | ||
579 | + tempbirth_time = temp_year + '-' + temp_month + '-'+day | ||
580 | + console.log(tempbirth_time) | ||
581 | + | ||
571 | 582 | ||
572 | } | 583 | } |
573 | }, | 584 | }, |
-
请 注册 或 登录 后发表评论