mini-software / MiniExcel

Fast, Low-Memory, Easy Excel .NET helper to import/export/template spreadsheet (support Linux, Mac)
https://www.nuget.org/packages/MiniExcel/
Apache License 2.0
2.81k stars 344 forks source link

Custom DateTime format #616

Closed DancePanda42 closed 5 months ago

DancePanda42 commented 5 months ago

Allows the user to define a user-defined date format, whereby the date information is not lost.

this will be fix also the issue #424

sorry but I also had to remove the goto 😄

jiaguangli commented 5 months ago

thanks for your pull request, i have replied issure #424, Do we really need this feature? We should discuss this seriously.

DancePanda42 commented 5 months ago

Hi, For me, the main reason for this feature is that it makes it easier to use the filter for a date in Excel. Which unfortunately is not the case if the date is a string. Maybe I didn't understand the issue correctly. I thought that would pursue the same goal.

jiaguangli commented 5 months ago

Hi, For me, the main reason for this feature is that it makes it easier to use the filter for a date in Excel. Which unfortunately is not the case if the date is a string. Maybe I didn't understand the issue correctly. I thought that would pursue the same goal.

No, you are correct, but we have to consider whether this approach makes sense and whether it will cause trouble in the future. It's really hard to decide. As a developer, this is good, but for non-developers, it may not be very practical

Please don't remove your pull request, maybe we will need this feature in the future

jiaguangli commented 5 months ago

image image image

Format = "dd.mm.yyyy hh:mm:ss" doesn't actually work for excel,Maybe this is not the result we want.

DancePanda42 commented 5 months ago

image image

It was never my intention to change the default date format to dd.mm.yyyy hh:mm:ss. My PR rather referred to the comment // TODO: now it'll lose date type information. As a result, nothing should change for the users, except that the date information will now be available in Excel. Of course, if users have been further processing the string within the Excel table, this would be a breaking change since it is now a DateOA double instead of a string.

jiaguangli commented 5 months ago

Sorry, I misunderstood what you meant before ,

Can SaveAsync() also be supported? And GenerateSheetByIDataReader Thank you for your contribution

DancePanda42 commented 5 months ago

Hi, yes no problem. I think the reference to the issue took things in the wrong direction.

Support for async should not be a big effort anymore. The support for GenerateSheetByIDataReader is already provided. DynamicColumnsConfigurationIsUsedWhenCreatingExcelUsingIDataReader

Additionally, I was considering implementing the support for the templates as well. For that, I will open a new PR when the time comes.

jiaguangli commented 5 months ago

Hi, yes no problem. I think the reference to the issue took things in the wrong direction.

Support for async should not be a big effort anymore. The support for GenerateSheetByIDataReader is already provided. DynamicColumnsConfigurationIsUsedWhenCreatingExcelUsingIDataReader

Additionally, I was considering implementing the support for the templates as well. For that, I will open a new PR when the time comes.

Hi,please sign your commits,Learn more about signing commits

shps951023 commented 5 months ago

👍👍👍 @DancePanda42 Could we invite you to our team?