Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sito
poul.org
Commits
b280061d
Commit
b280061d
authored
Apr 12, 2021
by
Andrew
Browse files
"preprocessing_editions()" sorting dates in correct order
parent
8093d3d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
_plugins/courses_pages_generator.rb
View file @
b280061d
...
...
@@ -99,8 +99,8 @@ module Jekyll
site
.
data
[
"courses"
].
each
do
|
n
,
v
|
# checks begins and ends values
if
!
v
[
"begin"
]
or
!
v
[
"ends"
]
# retrieves dates from schedule
dates
=
v
[
"schedule"
].
map
{
|
s
|
s
[
"date"
]
}.
select
{
|
d
|
d
!=
nil
}.
map
{
|
d
|
DateTime
.
parse
(
d
)
}.
sort
# retrieves dates from schedule
dates
=
v
[
"schedule"
].
map
{
|
s
|
s
[
"date"
]
}.
select
{
|
d
|
d
!=
nil
}.
map
{
|
d
|
DateTime
.
parse
(
d
)
}.
reverse
# if schedule dates are set they are used for update begins and ends
if
dates
.
size
!=
0
...
...
@@ -160,4 +160,4 @@ module Jekyll
self
.
process
(
@name
)
end
end
end
\ No newline at end of file
end
Write
Preview
Markdown
is supported
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