Skip to content

Commit

Permalink
v2.2.8 (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoldello committed Sep 27, 2023
1 parent 1249ef8 commit 2fb2778
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Rec-to-NWB YAML Generator",
"version": "2.2.7",
"version": "2.2.8",
"description": "Create YAML File for Spyglass",
"keywords": [
"electron",
Expand Down
7 changes: 5 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,12 @@ const generateYMLFile = (e) => {

if (isValid && isFormValid) {
const yAMLForm = convertObjectToYAMLString(form);
const fileNameDate = form.subject.date_of_birth.substring(0,10).replaceAll('-', '');
const fileDate = new Date();
const fileNameYear = `${fileDate.getFullYear()}`;
const fileNameMonth = `${fileDate.getMonth() + 1}`.padStart(2, '0');
const fileNameDay = `${fileDate.getDate()}`.padStart(2, '0');
const subjectId = formData.subject.subject_id.toLocaleLowerCase();
createYAMLFile(`${fileNameDate}_${subjectId}_metadata.yml`, yAMLForm);
createYAMLFile(`${fileNameYear}${fileNameMonth}${fileNameDay}_${subjectId}_metadata.yml`, yAMLForm);
return;
}

Expand Down

0 comments on commit 2fb2778

Please sign in to comment.