Locode PostgreSQL timestamp

I started using it with Locode PostgreSQL database and ran into a problem. I have a People table:

public class People
{
[AutoIncrement]
public long Id { get; set; }
public string Title { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string DisplayName { get; set; }
public string MotherName { get; set; }
public string PlaceOfBirth { get; set; }
public DateTime BirthOfDate { get; set; }
public string Phone { get; set; }
public string PrimaryEmail { get; set; }
}

DateTime in PostgreSQL became timestamp without timezone, which also works correctly when I use it on a razor page:

Apis=“Apis.AutoQuery<QueryPeoples,CreatePeople,UpdatePeople,DeletePeople>()” />

QueryPeoples

UpdatePeople

However, on the Locode page, you do not fill in the field

What am I messing up? I have to force to PostgreSQL date?
[CustomField(“date”)]

In this case, it will not be compatible with any other database.

What Culture is this using? Can you also provide the JSON API Response that locode uses to display the edit page.

Culture is hu-HU.

JSON
{
“offset”: 0,
“total”: 0,
“results”: [
{
“id”: 1,
“firstName”: “Kiss”,
“lastName”: “Zoltán”,
“birthOfDate”: “1972-12-05T00:00:00”,
“rowVersion”: 1907183
}
],
“meta”: {}
}

I’ve resolved an issue with date input controls in the latest ServiceStack v8.4.1 release that’s now available in our pre-release packages.

If your project template has a postinstall.js in its Host Project directory you’ll also want to rerun that as well to get the latest version of the Vue libs.

$ node postinstall.js

I installed Servicestack 8.4.1, but unfortunately, it still doesn’t work for me.
I downloaded several example projects - Chinook, TalentBlazor - but none of them are good.
Chinook invoices-before update:

Chinook invoices -after update:

I changed the culture (en-GB, en-US), but the situation is the same. It is clear that the date format is different in the two cases in the JSON.

There are other such e.g. [ValidateGreaterThan(0)] works on a Locode page, but doesn’t work when I use it on a razor page.It is visible on the console, but the message is not displayed.



The strangest thing is that if you go to razor page, then locode, then razor page, you get this error message:

Thanks for the help, and sorry if I’m a beginner, but I don’t understand why the two usages are different.

Could you put together a reproduction project on a public GitHub and document how you are changing the culture if it is in the browser or other than in code? Once we can reliably reproduce the problem, we’ll have a better chance of identifying the root cause and resolving it. Thanks.

I’ve been testing it on the Chinook example project lately, isn’t that a good reference?

I set this:

var supportedCultures = new List<CultureInfo>
{
    new CultureInfo("en-GB"),
    new CultureInfo("en-US"),
    new CultureInfo("hu-HU")
};

var requestLocalizationOptions = new RequestLocalizationOptions
{
    DefaultRequestCulture = new RequestCulture("en-US"),
    SupportedCultures = supportedCultures,
    SupportedUICultures = supportedCultures
};

services.Configure<RequestLocalizationOptions>(options => {
    options.DefaultRequestCulture = new RequestCulture(requestLocalizationOptions.DefaultRequestCulture.Culture.Name);
    options.SupportedCultures = requestLocalizationOptions.SupportedCultures;
    options.SupportedUICultures = requestLocalizationOptions.SupportedCultures;
});

and

app.UseRequestLocalization(requestLocalizationOptions);

Nothing has changed.

After I set the Edge language from Hungarian to English, in this case the result:

But, when I changed a application url from localhost to the computer IP address 192.168.0.100, then it is working!

Although this is not enough for me, it should work in a Hungarian environment, but that is not good in any scenario!

It is, but ambiguity with these kinds of problems is likely to waste time, so being on the same page via looking at the same implementation can help remove some of that.

To that, I forked Chinook here and made the changes I think you outlined (after a few fixes). If you could please review to make sure they match what you have.

This is not something I do very often, and browsers are different, but after installing Edge, here is where I changed the language.

Does this match what you are doing as well?

It is worth noting I am on Linux (PopOS! 22.04), so any information of your OS setup would be appreciated.

Here is what I see:

The dates are off by one day here likely to do with the data in the chinook example not having timezones, and my local machine being at +11 UTC. This is likely an unrelated problem, but this is again different to what you are seeing.

If you can please review the example and submit any changes to that repository if the updates I made are wrong so we are both looking at the same problem. Thanks.

Note, if I use the following SQL statement to update the example data to be in a better format, the issue due to timezones goes away.

UPDATE invoices SET InvoiceDate =
                        substr(InvoiceDate, 1, 10) || 'T' || substr(InvoiceDate, 12, 8) || 'Z';

To clarify, the original issue you had was with a Postgres database? The Chinook example is in SQLite, so if you could confirm if you are seeing the same problem with SQLite or if you imported the Chinook data into Postgres feel free to create a pull request or fork of that repository using Postgres via a docker container again so it can be reproduced.