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:
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.
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:
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.
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;
});
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.
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.
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.
Sorry for the late response, it’s working now, but I don’t understand why it wasn’t before.
I set the language in the right place and when I downloaded the forked Chinook app for the first time it still didn’t work.
I deleted all the nuget packages, deleted all the bin and obj directories, restarted the browser, but it wasn’t enough.
After that I didn’t have time to deal with it, when I came back it was already working.
Probably some kind of cache, I don’t know what, but very thanks for the help, the problem must have been here.