给出日期格式,如:
我如何将其分成:
time.push({
Day : [],
Month : [],
Year : [],
Prefix : []
});
试一试,我做了:
dateText = "27 - 28 August 663 CE";
for(var i = 0; i < dateText.length; i++) {
d += dateText[i] + ' ';
}
dates[0].Time.push(d)
但结果是:
dates.push({
"Time": [
"27 - 28 August 663 CE ",
更新
按照上面的说法将解析后的日期推送到多维数组后,我想创建:
<ul class="Days">
<li>27</li>
<li>28</li>
</ul>
<ul class="Months">
<li>August</li>
</ul>
<ul class="Year">
<li>663</li>
</ul>