Commit 9baad333 authored by Maxime Chaillet's avatar Maxime Chaillet

change publication year so that it correspond to the minting year.

parent 92d5f8ec
This diff is collapsed.
This diff is collapsed.
......@@ -28,8 +28,10 @@ DOIController.prototype.getData = function(doi) {
success : function(doiData) {
if (doiData) {
// extract fields from doiData.categories
extractFieldsFromCategories(doiData);
// extract dates for doi landing page
extractDates(doiData);
// extract specific fields from doiData
extractFields(doiData);
//extractInvestigationId from doiData.doi
extractFieldsFromDoi(doiData);
// create citation
......@@ -132,11 +134,17 @@ function findRegExpInText(regExp, text) {
return text.search(regExp);
}
// extract dates as required for the DOI landing page
function extractDates(data){
//publication Year in doi landing page is the minting year
data.mintingYear = new Date(data.date_registered).getFullYear();
}
// Extract beamline, proposal number and proposal type from the data fields as received from the json response.
// Extract beamline, proposal number and proposal type from the data json object
// Add the corresponding fields in the data object
// @data: the data object, it is a reference
function extractFieldsFromCategories(data) {
function extractFields(data) {
_.forEach(data.subject[0], function(value){
switch (value.subject_scheme ) {
case "Proposal Type Description":
......
......@@ -18,7 +18,7 @@
<div class="col-3">
<div class="myBorder-left">
<label> Publication year </label>
<div class="padding-left-15">{data.publication_year}</div>
<div class="padding-left-15">{data.mintingYear}</div>
</div>
</div>
<div class="col-6">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment