Calendar fixes
gitea/salix/dev This commit looks good Details

This commit is contained in:
Juan Ferrer 2019-09-26 15:39:08 +02:00
parent 455d953e9a
commit 83c6d15eb1
1 changed files with 9 additions and 7 deletions

View File

@ -204,7 +204,7 @@ export default class Calendar extends Component {
return event.dated >= dated && event.dated <= dated;
});
const params = {dated: dated, events: events, style: {}};
const params = {dated: dated, events: events /**/, style: {}};
const isSaturday = dated.getDay() === 6;
const isSunday = dated.getDay() === 0;
const isCurrentMonth = dated.getMonth() === this.currentMonth.getMonth();
@ -290,13 +290,15 @@ export default class Calendar extends Component {
renderStyle(style) {
const normalizedStyle = {};
const properties = Object.keys(style);
properties.forEach(attribute => {
const attrName = attribute.split(/(?=[A-Z])/).
join('-').toLowerCase();
if (style) {
const properties = Object.keys(style);
properties.forEach(attribute => {
const attrName = attribute.split(/(?=[A-Z])/).
join('-').toLowerCase();
normalizedStyle[attrName] = style[attribute];
});
normalizedStyle[attrName] = style[attribute];
});
}
return normalizedStyle;
}