Skip to content

Commit

Permalink
fix date format error. enable dynamic changing file name.
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzihaofzh committed Aug 10, 2018
1 parent 8da91b1 commit f6688dc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@



<el-dialog title="配置" :visible.sync="itemConfigFormVisible" :show-close=false width="80%">
<el-dialog title="Config" :visible.sync="itemConfigFormVisible" :show-close=false width="80%">
<el-form :model="itemConfigFormData">
<el-form-item label="路径">
<el-form-item label="Library Path">
<el-input v-model="itemConfigFormData.libpath" type="textarea" autosize auto-complete="off" ></el-input>
</el-form-item>
<el-form-item label="期刊名">
<el-form-item label="Journals">
<el-input v-model="itemConfigFormData.ConferenceMap" type="textarea" autosize auto-complete="off"></el-input>
</el-form-item>

Expand All @@ -48,13 +48,13 @@
<el-input v-model="itemEditFormData.title" type="textarea" autosize auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="Journal">
<el-input v-model="itemEditFormData.journal" type="textarea" autosize auto-complete="off" @change="changNameByNewInfo"></el-input>
<el-input v-model="itemEditFormData.journal" type="textarea" autosize auto-complete="off" @input="changNameByNewInfo"></el-input>
</el-form-item>
<el-form-item label="Authors">
<el-input v-model="itemEditFormData.authors" type="textarea" autosize auto-complete="off" @change="changNameByNewInfo"></el-input>
<el-input v-model="itemEditFormData.authors" type="textarea" autosize auto-complete="off" @input="changNameByNewInfo"></el-input>
</el-form-item>
<el-form-item label="Year">
<el-input v-model="itemEditFormData.year" type="textarea" autosize auto-complete="off" @change="changNameByNewInfo"></el-input>
<el-input v-model="itemEditFormData.year" type="textarea" autosize auto-complete="off" @input="changNameByNewInfo"></el-input>
</el-form-item>
<el-form-item label="tags">
<el-input v-model="itemEditFormData.tags" type="textarea" autosize auto-complete="off"></el-input>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PaperArxiv",
"version": "0.0.2",
"version": "0.0.3",
"description": "A paper management tool",
"main": "main.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ function DBManager(ctx) {
return 0;
});
this.updateItemInfo = function(oriName){
var d = new Date()
ctx.ctor.itemEditFormData.updateTime = d.toLocaleDateString().replace(/\//g,'-').slice(0, 10) + ' ' + d.toTimeString().slice(0, 8);
var tzoffset = (new Date()).getTimezoneOffset() * 60000;
ctx.ctor.itemEditFormData.updateTime = (new Date(Date.now() - tzoffset)).toISOString().slice(0, -5).replace('T', ' ');
ctx.itemEditFormDataStandard = utils.deepcopy(ctx.ctor.itemEditFormData);
var findItemId = 0;
for(;findItemId < ctx.tableData.length && ctx.tableData[findItemId].name !== oriName; ++findItemId);
Expand Down
4 changes: 2 additions & 2 deletions src/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ function extractFromPdfFile(filePath, ctx) {
}
pdfInfo.name = ([pdfInfo.year, pdfInfo.journal, authors[0].replace(/[\%\/\<\>\^\|\?\&\#\*\\\:\" \n]/g, '')].join('-') + '.pdf').replace(/[\%\/\<\>\^\|\?\&\#\*\\\:\" ]/g, '');
pdfInfo.authors = authors.map(x => x.trim()).join('\n')
var d = new Date()
pdfInfo.addTime = d.toLocaleDateString().replace(/\//g,'-').slice(0, 10) + ' ' + d.toTimeString().slice(0, 8);
var tzoffset = (new Date()).getTimezoneOffset() * 60000;
pdfInfo.addTime = (new Date(Date.now() - tzoffset)).toISOString().slice(0, -5).replace('T', ' ');
pdfInfo.updateTime = pdfInfo.addTime;
pdfInfo.content = child_process.execSync('pdftohtml -q -xml -i -stdout -fontfullname "' + filePath + '"', {env:{PATH: process.env.PATH + ':/usr/local/bin'}}).toString().replace(/<\/?[^>]+(>|$)/g, "").split('\n').filter(x => x.length > 10).join('\n');
pdfInfo.tags = "";
Expand Down

0 comments on commit f6688dc

Please sign in to comment.