[GH-ISSUE #607] Invalid dates when importing from CSV #7183

Closed
opened 2026-04-10 16:52:53 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @caseymullineaux on GitHub (Jan 28, 2023).
Original GitHub issue: https://github.com/actualbudget/actual/issues/607

When importing transactions from a CSV using the DD/MM/YYYY format, a small percentage of date values are interpreted invalid.

image
Originally created by @caseymullineaux on GitHub (Jan 28, 2023). Original GitHub issue: https://github.com/actualbudget/actual/issues/607 When importing transactions from a CSV using the DD/MM/YYYY format, a small percentage of date values are interpreted invalid. <img width="792" alt="image" src="https://user-images.githubusercontent.com/25874787/215294510-edbd838b-3e4c-4859-9587-3867ef997159.png">
GiteaMirror added the transactionsgood first issuebughelp wanted labels 2026-04-10 16:52:54 -05:00
Author
Owner

@MatissJanis commented on GitHub (Jan 31, 2023):

👋 Would you mind sharing a reproduction CSV file?

Thanks!

<!-- gh-comment-id:1413864887 --> @MatissJanis commented on GitHub (Jan 31, 2023): 👋 Would you mind sharing a reproduction CSV file? Thanks!
Author
Owner

@caseymullineaux commented on GitHub (Feb 2, 2023):

Sure no problem.
Here's a redacted version of a CSV that demonstrates the issue.
2020-12-sanitised.csv

<!-- gh-comment-id:1413864896 --> @caseymullineaux commented on GitHub (Feb 2, 2023): Sure no problem. Here's a redacted version of a CSV that demonstrates the issue. [2020-12-sanitised.csv](https://github.com/actualbudget/actual-server/files/10564325/2020-12-sanitised.csv)
Author
Owner

@MatissJanis commented on GitHub (Feb 2, 2023):

Thanks, the example file is great! I'm able to reproduce the issue.

<!-- gh-comment-id:1414159460 --> @MatissJanis commented on GitHub (Feb 2, 2023): Thanks, the example file is great! I'm able to reproduce the issue.
Author
Owner

@cacti23 commented on GitHub (Feb 5, 2023):

@j-f1 please assign me this issue i would love to work on it.

<!-- gh-comment-id:1416933377 --> @cacti23 commented on GitHub (Feb 5, 2023): @j-f1 please assign me this issue i would love to work on it.
Author
Owner

@rich-howell commented on GitHub (Feb 5, 2023):

@j-f1 please assign me this issue i would love to work on it.

This has been assigned to you as requested :) let us know if you need anything.

<!-- gh-comment-id:1417123484 --> @rich-howell commented on GitHub (Feb 5, 2023): > @j-f1 please assign me this issue i would love to work on it. This has been assigned to you as requested :) let us know if you need anything.
Author
Owner

@cacti23 commented on GitHub (Feb 5, 2023):

@rich-howell will looking into issue I found that the date is parsing correctly. Check out the two pictures shown below:
Screenshot 2023-02-05 at 7 20 21 PM
Screenshot 2023-02-05 at 7 22 22 PM

Picture ->

  1. Shows the problem mentioned in the issue
  2. I printed the parsed transaction in the console and can see the dates being parse correctly.

Please do let me know if my understanding is correct.

<!-- gh-comment-id:1417918267 --> @cacti23 commented on GitHub (Feb 5, 2023): @rich-howell will looking into issue I found that the date is parsing correctly. Check out the two pictures shown below: <img width="800" alt="Screenshot 2023-02-05 at 7 20 21 PM" src="https://user-images.githubusercontent.com/76640086/216823552-865bec03-51fe-4e0d-8710-13eaf5beda37.png"> <img width="833" alt="Screenshot 2023-02-05 at 7 22 22 PM" src="https://user-images.githubusercontent.com/76640086/216823558-ff1096a0-5ead-424f-927a-835ee9d628d5.png"> Picture -> 1. Shows the problem mentioned in the issue 2. I printed the parsed transaction in the console and can see the dates being parse correctly. Please do let me know if my understanding is correct.
Author
Owner

@rich-howell commented on GitHub (Feb 5, 2023):

@rich-howell will looking into issue I found that the date is parsing correctly. Check out the two pictures shown below: Screenshot 2023-02-05 at 7 20 21 PM Screenshot 2023-02-05 at 7 22 22 PM

Picture ->

1. Shows the problem mentioned in the issue

2. I printed the parsed transaction in the console and can see the dates being parse correctly.

Please do let me know if my understanding is correct.

So what is the issue? Why are the dates being rendered in the app as INVALID

<!-- gh-comment-id:1418013380 --> @rich-howell commented on GitHub (Feb 5, 2023): > @rich-howell will looking into issue I found that the date is parsing correctly. Check out the two pictures shown below: <img alt="Screenshot 2023-02-05 at 7 20 21 PM" width="800" src="https://user-images.githubusercontent.com/76640086/216823552-865bec03-51fe-4e0d-8710-13eaf5beda37.png"> <img alt="Screenshot 2023-02-05 at 7 22 22 PM" width="833" src="https://user-images.githubusercontent.com/76640086/216823558-ff1096a0-5ead-424f-927a-835ee9d628d5.png"> > > Picture -> > > 1. Shows the problem mentioned in the issue > > 2. I printed the parsed transaction in the console and can see the dates being parse correctly. > > > Please do let me know if my understanding is correct. So what is the issue? Why are the dates being rendered in the app as `INVALID`
Author
Owner

@cacti23 commented on GitHub (Feb 6, 2023):

@rich-howell parseDateFormat and dateFormat is different. Check the image:

Screenshot 2023-02-06 at 12 57 08 PM

It is occurring in ImportTransactions.js file at line 882 where connect fuction is called:

export default connect(
  state => ({
    dateFormat: state.prefs.local.dateFormat || 'MM/dd/yyyy',
    prefs: state.prefs.local
  }),
  actions
)(ImportTransactions);

state.prefs.local.dateFormat is null.

Can you please help me here as to why it is coming null or just direct me.

<!-- gh-comment-id:1418621476 --> @cacti23 commented on GitHub (Feb 6, 2023): @rich-howell parseDateFormat and dateFormat is different. Check the image: ![Screenshot 2023-02-06 at 12 57 08 PM](https://user-images.githubusercontent.com/76640086/216910429-adaa0553-4185-46ac-9773-4785c6745fbf.png) It is occurring in ImportTransactions.js file at line 882 where connect fuction is called: ``` export default connect( state => ({ dateFormat: state.prefs.local.dateFormat || 'MM/dd/yyyy', prefs: state.prefs.local }), actions )(ImportTransactions); ``` state.prefs.local.dateFormat is null. Can you please help me here as to why it is coming null or just direct me.
Author
Owner

@j-f1 commented on GitHub (Feb 6, 2023):

I suspect the issue is that the format is expecting a two-digit day (dd) such as 01/12/2020 but the inputted date has a one digit day (i.e. 1/12/2020). Ideally both the day and month inputs should allow the zero prefix to be optional.

<!-- gh-comment-id:1419036033 --> @j-f1 commented on GitHub (Feb 6, 2023): I suspect the issue is that the format is expecting a two-digit day (`dd`) such as `01/12/2020` but the inputted date has a one digit day (i.e. `1/12/2020`). Ideally both the day and month inputs should allow the zero prefix to be optional.
Author
Owner

@MatissJanis commented on GitHub (Feb 24, 2023):

This will be fixed in the next release: v23.3.x

<!-- gh-comment-id:1444587604 --> @MatissJanis commented on GitHub (Feb 24, 2023): This will be fixed in the next release: v23.3.x
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#7183