我有一组医生。每个人都有自己的专业(牙医、普通医生、精神病医生等)。
每个专业都有其预定义的会话(指定)时间,例如:
每个医生都有自己的行程表。
我使用jQuery和两个(2) BSTimepicker字段将时隙分配给每个医生
http://jdewit.github.io/bootstrap-timepicker/
有没有办法(使用jQuery或MomentJS库)计算医生在指定的时隙中能够参加的(轮次)约会次数?
提前谢谢
发布于 2014-06-26 17:23:21
编辑、更新
试一试
var apps = [];
var meds = {
"psych": {
"schedule": 4.5,
"appointment_length" : function() {return this.schedule * 4},
"appointment_slots" : function() {return this.appointment_length() / 3}
},
"dentist": {
"schedule": 6,
"appointment_length" : function() {return this.schedule * 2},
"appointment_slots" : function() {return this.appointment_length() / 2}
}
};
$.each(meds, function (index, value) {
apps.push([index, Math.round(value.appointment_slots())]);
meds.appointments = apps.slice(0, 2);
});
console.log(meds);
jsfiddle http://jsfiddle.net/guest271314/sdxLH/
https://stackoverflow.com/questions/24435377
复制相似问题