0
我想顯示開口小時,一個註冊用戶的註冊時填寫在一週價值的缺失天填寫:jQuery的 - 從對象
這是「value
」 &它以這種方式存儲在DB:
[
{"day":"Maandag","daylabel":"Maandag","fromtime":"15:30","fromtimelabel":"3:30 pm","totime":"22:00","totimelabel":"10:00 pm"},
{"day":"Dinsdag","daylabel":"Dinsdag","fromtime":"15:30","fromtimelabel":"3:30 pm","totime":"22:00","totimelabel":"10:00 pm"},
{"day":"Donderdag","daylabel":"Donderdag","fromtime":"15:30","fromtimelabel":"3:30 pm","totime":"22:00","totimelabel":"10:00 pm"},
{"day":"Vrijdag","daylabel":"Vrijdag","fromtime":"15:30","fromtimelabel":"3:30 pm","totime":"22:00","totimelabel":"10:00 pm"},
{"day":"Zaterdag","daylabel":"Zaterdag","fromtime":"09:30","fromtimelabel":"9:30 am","totime":"+00:00","totimelabel":"12:00 am (next day)"},
{"day":"Zondag","daylabel":"Zondag","fromtime":"09:30","fromtimelabel":"9:30 am","totime":"+00:00","totimelabel":"12:00 am (next day)"}
]
這是我的函數解析value
:
config.profile.core.parseAvailability = function(value){
if(value){
try {
var availabilityDays = JSON.parse(value);
$jq.each(availabilityDays, function(index, day) {
$jq('#availability').append('<div class="col-sm-5">'+day['daylabel']+'</div><div class="col-sm-7">'+day['fromtime']+' - '+day['totime']+'</div>');
});
} catch (error) {
console.error(error);
}
}
};
這是它會顯示在p的方式年齡:
問題:
正如你或許可以看到,週三(在 'dinsdag' & 'donderdag'之間的荷蘭人 'woensdag' )當天丟失,因爲它並非故意填充(可能會在特定的一天關閉)。因爲那一天沒有儲存,我無法顯示它。
我該如何顯示缺少空白值的日子?
非常感謝你。 – Mark