Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nos Hs2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Språksamlingane
stadnamn
Nos Hs2023
Commits
63f629ac
Commit
63f629ac
authored
5 years ago
by
esikkala
Browse files
Options
Downloads
Patches
Plain Diff
Properly sort production dates
parent
42d5fed3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/client/components/facet_results/ResultTableCell.js
+27
-1
27 additions, 1 deletion
src/client/components/facet_results/ResultTableCell.js
src/server/sparql/SparqlQueriesManuscripts.js
+2
-2
2 additions, 2 deletions
src/server/sparql/SparqlQueriesManuscripts.js
with
29 additions
and
3 deletions
src/client/components/facet_results/ResultTableCell.js
+
27
−
1
View file @
63f629ac
...
@@ -21,6 +21,25 @@ const styles = () => ({
...
@@ -21,6 +21,25 @@ const styles = () => ({
const
ResultTableCell
=
props
=>
{
const
ResultTableCell
=
props
=>
{
const
ISOStringToDate
=
str
=>
{
let
year
;
let
month
;
let
day
;
if
(
str
.
charAt
(
0
)
==
'
-
'
)
{
year
=
parseInt
(
str
.
substring
(
0
,
5
));
month
=
parseInt
(
str
.
substring
(
7
,
8
));
day
=
parseInt
(
str
.
substring
(
10
,
11
));
}
else
{
year
=
parseInt
(
str
.
substring
(
0
,
4
));
month
=
parseInt
(
str
.
substring
(
6
,
7
));
day
=
parseInt
(
str
.
substring
(
9
,
10
));
}
// console.log(year)
// console.log(month)
// console.log(day)
return
new
Date
(
year
,
month
,
day
);
};
const
stringListRenderer
=
cell
=>
{
const
stringListRenderer
=
cell
=>
{
if
(
cell
==
null
||
cell
===
'
-
'
){
if
(
cell
==
null
||
cell
===
'
-
'
){
return
'
-
'
;
return
'
-
'
;
...
@@ -43,7 +62,14 @@ const ResultTableCell = props => {
...
@@ -43,7 +62,14 @@ const ResultTableCell = props => {
}
}
else
if
(
Array
.
isArray
(
cell
))
{
else
if
(
Array
.
isArray
(
cell
))
{
if
(
props
.
columnId
==
'
productionTimespan
'
)
{
if
(
props
.
columnId
==
'
productionTimespan
'
)
{
cell
=
sortValues
?
sortBy
(
cell
,
obj
=>
Number
(
obj
.
start
))
:
cell
;
cell
=
sortValues
?
cell
.
sort
((
a
,
b
)
=>
{
a
=
ISOStringToDate
(
a
.
start
);
b
=
ISOStringToDate
(
b
.
start
);
// arrange from the most recent to the oldest
return
a
>
b
?
1
:
a
<
b
?
-
1
:
0
;
})
:
cell
;
}
else
{
}
else
{
cell
=
sortValues
?
orderBy
(
cell
,
'
prefLabel
'
)
:
cell
;
cell
=
sortValues
?
orderBy
(
cell
,
'
prefLabel
'
)
:
cell
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/server/sparql/SparqlQueriesManuscripts.js
+
2
−
2
View file @
63f629ac
...
@@ -18,8 +18,8 @@ export const manuscriptProperties = `
...
@@ -18,8 +18,8 @@ export const manuscriptProperties = `
?production crm:P108_has_produced ?id .
?production crm:P108_has_produced ?id .
?production crm:P4_has_time-span ?productionTimespan .
?production crm:P4_has_time-span ?productionTimespan .
?productionTimespan skos:prefLabel ?productionTimespan__id .
?productionTimespan skos:prefLabel ?productionTimespan__id .
OPTIONAL { ?productionTimespan crm:P
79
_begin
ning_is_qualified_by
?productionTimespan__start }
OPTIONAL { ?productionTimespan crm:P
82a
_begin
_of_the_begin
?productionTimespan__start }
OPTIONAL { ?productionTimespan crm:P8
0
_end_
is_qualified_by
?productionTimespan__end }
OPTIONAL { ?productionTimespan crm:P8
2b
_end_
of_the_end
?productionTimespan__end }
BIND (?productionTimespan__id AS ?productionTimespan__prefLabel)
BIND (?productionTimespan__id AS ?productionTimespan__prefLabel)
}
}
UNION
UNION
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment