Replies: 1 comment 2 replies
-
This is something you should tackle in your own code, like validation rules etc. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?
What version of Laravel Excel are you using?
3.1
What version of Laravel are you using?
9
What version of PHP are you using?
8.0.28
Describe your issue
The Excel sheet contains numeric values like the Excel date timestamp format also leads to importing the data wrongly.
For example, an Excel column numeric date timestamp value of date
28/02/2024 (in Maatwesite, its captured value is 45350
) in column A, and the same Excel sheet column B has a numeric value of45444 (let us consider this column value as amount)
.If the User by mistake wrongly formatted the values like column A has
amount
and column B hasExcel date timestamp
, then hit the import button allows the user to import the Excel data wrongly into DB.I need to control it and tell the user about their mistake before importing large data.
Because the
Date::excelToDateTimeObject($row['colum_A'])->format('Y-m-d')
allows us to convert the amount column data like numeric values also into the date in this method.I can't able to catch this wrong date column import in this package. So we need to figure out a way to capture the date column as it is so that we can able to check the date format and stop filling the DB with the wrong data import.
How can the issue be reproduced?
Below is my
Import
class function sample:Attached file to reproduce the issue.
Maatwebsite_issue_reproduce.xlsx
What should be the expected behaviour?
Need to check and throw a bug report while initiating data import when column A is not a valid date column and if there is a valid date then the data should be imported into DB.
Beta Was this translation helpful? Give feedback.
All reactions