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

DateTimeOffset handling in formatDateTimeOffset #197

Open
tonyjoanes opened this issue Sep 20, 2019 · 0 comments
Open

DateTimeOffset handling in formatDateTimeOffset #197

tonyjoanes opened this issue Sep 20, 2019 · 0 comments

Comments

@tonyjoanes
Copy link

We're using some DateTimeOffset datatypes in our MSSQL database and require the offset to be passed back to the server.

The function formatDateTimeOffset performs a hasOffset check on the value passed in but this only receives a DateTime from what I have seen. The means it never returns a DateTimeOffset from the function and we can't receive the correct value back on the server.

The check it performs on the value is the following snippet of code and it assumes fields that the parameter never has.

var isDateTimeOffset = function (value) {
        /// <summary>Checks whether a Date object is DateTimeOffset value</summary>
        /// <param name="value" type="Date" mayBeNull="false">Value to check.</param>
        /// <returns type="Boolean">true if the value is a DateTimeOffset, false otherwise.</returns>
        return (value.__edmType === "Edm.DateTimeOffset" || (!value.__edmType && value.__offset));
    };

I can hack around this but I am wondering if there is some setup missing from somewhere to get DateTimeOffsets to play nicely with the BreezeJS and DataJs frameworks.

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

1 participant