Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] allow for n/a to be a valid date in acq_time #539

Merged
merged 2 commits into from
Aug 31, 2018

Conversation

sappelhoff
Copy link
Member

fixes #538

@chrisgorgo
Copy link
Contributor

Could you modify or add a test covering this case? Thanks!

@sappelhoff
Copy link
Member Author

also fixes mne-tools/mne-bids#71 (comment)

@sappelhoff sappelhoff changed the title allow for n/a to be a valid date in acq_time [MRG] allow for n/a to be a valid date in acq_time Aug 31, 2018
@jasmainak
Copy link
Collaborator

Thanks @sappelhoff for the PR !

@@ -326,7 +326,10 @@ const checkAcqTimeFormat = function(rows, file, issues) {
const line = testRows[i]
const lineValues = line.trim().split('\t')
const acqTime = lineValues[acqTimeColumn]
const isValid = dateIsValid(parseDate(acqTime, format, new Date()))
var isValid = dateIsValid(parseDate(acqTime, format, new Date()))
if (acqTime === 'n/a') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if acqTime is 'n/a' why does parseDate not throw an error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it returns Invalid Date if the parsing according to format fails

@chrisgorgo
Copy link
Contributor

Thanks!

@chrisgorgo chrisgorgo merged commit 958c413 into bids-standard:master Aug 31, 2018
@sappelhoff sappelhoff deleted the fix_acq_time_na branch August 31, 2018 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

acq_time should allow for n/a but currently it doesn't
3 participants