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

Unable to map date to DateOnly datatype #137

Open
rasupit opened this issue May 7, 2024 · 2 comments
Open

Unable to map date to DateOnly datatype #137

rasupit opened this issue May 7, 2024 · 2 comments

Comments

@rasupit
Copy link

rasupit commented May 7, 2024

Mapping to DateOnly data type is not working or at least it can be done is not so straight forward way.

My current work around as follows:
`

            mapper.Map<FeedSapTivBill>("Invoice date", r => r.InvoiceDate, (s, t) => {
                if (s.HeaderValue == null) return false;

                ((FeedSapTivBill)t).InvoiceDate = DateOnly.FromDateTime((DateTime)s.CurrentValue);
                return true;
            }

It will be nice if it will work outomatically

@dcjxdd123
Copy link
Contributor

you already get Exact DateTime

@rasupit
Copy link
Author

rasupit commented May 7, 2024

you already get Exact DateTime

Yes, however I'm mapping it to DateOnly type, therefore I have to convert the value to DateOnly. In this example is from datetime

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

No branches or pull requests

2 participants