mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-12-25 05:43:46 +01:00
Create pubUtils.getIssuedDate(publi) tool to get the date of a publication object
This commit is contained in:
parent
414bbb44dc
commit
6d38d7be1f
@ -7,4 +7,5 @@
|
||||
<script type="text/javascript" id="MathJax-script" async
|
||||
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
|
||||
</script>
|
||||
<script src="https://cdn.rawgit.com/larsgw/citation.js/archive/citation.js/citation-0.4.0-9.js" type="text/javascript"></script>
|
||||
<script src="https://cdn.rawgit.com/larsgw/citation.js/archive/citation.js/citation-0.4.0-9.js" type="text/javascript"></script>
|
||||
<script src="/js/pubUtils.js"></script>
|
@ -50,8 +50,7 @@ function createPubliUI(publi,sets=new Map(),toolTips=false) {
|
||||
else {
|
||||
$("<span/>").text(publi["container-title"]).appendTo(journaldiv)
|
||||
}
|
||||
var datArr = publi.issued["date-parts"][0]
|
||||
var date = new Date(datArr[0], datArr[1] - 1, datArr[2])
|
||||
var date = pubUtils.getIssuedDate(publi)
|
||||
journaldiv.append(" ")
|
||||
$("<span/>").text(date.getFullYear().toString()).appendTo(journaldiv)
|
||||
journaldiv.append(" ")
|
||||
|
6
static/js/pubUtils.js
Normal file
6
static/js/pubUtils.js
Normal file
@ -0,0 +1,6 @@
|
||||
class pubUtils{
|
||||
static getIssuedDate(publi) {
|
||||
const parts=publi.issued["date-parts"][0]
|
||||
return new Date(parts[0], parts[1] - 1, parts[2])
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user