-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
[Feature] Add support for Date data type #21
Comments
Started working on this in beta (unstable) branch :: https://github.com/kawal7415/excel/tree/beta As we had started to work on providing Formula functionality, So we will be providing various CellType support. Thank You |
Is there a solution for this problem. Excel only recieves the fields as date if it is in the first column. For columns other than that, I get values such as 43959. |
Hello, did you manage to solve this issue? |
I am having the same issue indicated above |
Same issue. |
I found out about a workaround until this is officially fixed. Please take a look at this article that explains that number means. You can write a simple function to convert this number into a DateTime. How Dates Work in Excel – The Calendar System Explained + Video
|
Also, the date value that we receive is not consistent. The |
Or you could simply return the default string value as it appears on the Excel (dd-mm-yyyy) and let us parse it. That would be really simple and easy. |
@ashishbeck I thinks that the answer from @nipunasudha would be promising to help you out in this scenario until I push a fix for it. |
Of course, it must be a stress for you to dedicate to things outside of work and we are really grateful for it. All I can hope for is you to push fixes whenever possible. |
Awaiting for DateTime column ) |
Here's a simple static util method I use to convert excel dates to import 'package:jiffy/jiffy.dart';
static DateTime tryParseExcelDateTimeDouble(double dateDouble, {DateTime ifInvalid}) {
if (dateDouble == null || dateDouble < 1) return ifInvalid;
return Jiffy(DateTime(1900, 1, 1))
.add(days: dateDouble.toInt() - 1)
.dateTime;
} |
@nipunasudha your solution worked for me THANKS with just small issue its showing me one day ahead. Is that a big problem or should i manually add 1 day to it. |
It'll work if you change |
Is there a way to set a cell as a Date when exporting Excel? |
@BugsBuggy and how can we store date values? |
Any news? |
I implemented the support for date, time and date-time values, here is the PR: #279 # pubspec.yaml
dependencies:
excel
git: https://github.com/quaaantumdev/excel.git ( the repository may be deleted once the changes are merged ) |
Can you try version: excel: ^4.0.0 |
Hello, how do I receive the fields as Date?
I have a column with the fields as Date but when I order to display some numbers appear.
For example the date in the file is: 08/05/2020 12:00:00
No Flutter in print (as your example) appears: 43959.5
How to solve?
The text was updated successfully, but these errors were encountered: