Cite this: add doi info| in date keep only year (maybe wrong if extended to 1-1-)| change APA csl(turkish version used)

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51922 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2018-05-03 14:05:10 +00:00
parent 0ea6e5f774
commit 7ae91de956
2 changed files with 16 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -49,6 +49,18 @@ export class CiteThisComponent {
parseData(){
var citationData:CitationData = new CitationData();
if(this.result.identifiers && Array.from(this.result.identifiers.keys()).length > 0){
var keys = Array.from(this.result.identifiers.keys());
for (var i=0; i<keys.length;i++){
if(keys[i]=="doi"){
var ids = this.result.identifiers.get(keys[i]);
for (var j=0; j<ids.length;j++){
citationData.DOI = ids[j];
break;
}
}
}
}
citationData.id = this.id;
if(this.result.types != undefined && this.result.types.length > 0 && this.result.types[0]){
citationData.type = this.result.types[0].toLowerCase();
@ -79,12 +91,12 @@ export class CiteThisComponent {
if(this.result.dateofacceptance != undefined){
citationData.issued = {};
var date:string = (this.result.dateofacceptance)+""; // transform to string in case it is an integer
var dateArray:string[] = (date && (date).indexOf('-') !== -1)?date.split('-'):[date];
var dateArray:string[] = (date && (date).indexOf('-') !== -1)?[date.split('-')[0]]:[date];
if(dateArray.length < 3){
// dateArray.push[1];
// dateArray.push[1];
}
citationData.issued={"date-parts":[[""+dateArray[0],dateArray[1], dateArray[2]]]};
citationData.issued={"date-parts":[[""+dateArray[0]]]};
if(this.result.date ){
citationData.date = this.result.date ;
}