Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
ThaliApp
Commits
e3420c88
Commit
e3420c88
authored
Dec 13, 2017
by
Sébastiaan Versteeg
Browse files
Fix calendar ordering using years
parent
976b5361
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/components/Calendar.js
View file @
e3420c88
...
...
@@ -16,23 +16,25 @@ import styles from './style/calendar';
const
addEventToSection
=
(
sections
,
date
,
event
)
=>
{
const
day
=
date
.
date
();
const
month
=
date
.
month
();
const
year
=
date
.
year
();
const
sectionKey
=
(
year
*
100
)
+
month
;
if
(
!
(
month
in
sections
))
{
sections
[
month
]
=
{
if
(
!
(
sectionKey
in
sections
))
{
sections
[
sectionKey
]
=
{
key
:
date
.
format
(
'
MMMM
'
),
data
:
{},
};
}
if
(
!
(
day
in
sections
[
month
].
data
))
{
sections
[
month
].
data
[
day
]
=
{
if
(
!
(
day
in
sections
[
sectionKey
].
data
))
{
sections
[
sectionKey
].
data
[
day
]
=
{
dayNumber
:
day
,
dayOfWeek
:
date
.
format
(
'
dd
'
),
events
:
[],
};
}
sections
[
month
].
data
[
day
].
events
.
push
(
event
);
sections
[
sectionKey
].
data
[
day
].
events
.
push
(
event
);
};
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment