mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-25 04:52:52 +08:00
Merge branch 'feature/GFRS-1237【0525】国富人寿桂企保重大疾病保险' into dev
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
export default {
|
||||
getAge: function (name, today) {
|
||||
getAge: function(name, today) {
|
||||
return this.getAgeByValue(name, today)
|
||||
},
|
||||
|
||||
getAgeByBirth: function (value, today) {
|
||||
getAgeByBirth: function(value, today) {
|
||||
return this.getAgeByValue(value, today)
|
||||
},
|
||||
getAgeByValue: function (value, today) {
|
||||
getAgeByValue: function(value, today) {
|
||||
var b = value.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/)
|
||||
if (b == null) {
|
||||
return null
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
/**
|
||||
* 取得两个日期的时间差
|
||||
*/
|
||||
getDateDiff: function (date1, date2) {
|
||||
getDateDiff: function(date1, date2) {
|
||||
var dt1, dt2
|
||||
if (date1 instanceof Date) {
|
||||
dt1 = date1
|
||||
@@ -45,13 +45,14 @@ export default {
|
||||
} else {
|
||||
dt2 = this.stringToDate(date2)
|
||||
}
|
||||
return (dt2.getTime() - dt1.getTime()) / (1000 * 3600 * 24) + 1
|
||||
return (dt2.getTime() - dt1.getTime()) / (1000 * 3600 * 24)
|
||||
// return (dt2.getTime() - dt1.getTime()) / (1000 * 3600 * 24) + 1
|
||||
},
|
||||
|
||||
/**
|
||||
* 字符串转日期
|
||||
*/
|
||||
stringToDate: function (string) {
|
||||
stringToDate: function(string) {
|
||||
return new Date(Date.parse(string.replace(/-/g, '/')))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user