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

Regex fra dato-format i Studio matcher ikke dato i datepicker #2812

Open
cammiida opened this issue Dec 11, 2024 · 1 comment
Open

Regex fra dato-format i Studio matcher ikke dato i datepicker #2812

cammiida opened this issue Dec 11, 2024 · 1 comment
Assignees
Labels
kind/bug Something isn't working

Comments

@cammiida
Copy link
Contributor

cammiida commented Dec 11, 2024

Når man oppretter et tekstfelt med Dato-format i Studio får den automatisk en regex på seg som ikke matcher dato i datepicker i frontend og gjør slik at validering feiler.

Feil i frontend:
Image

Oppsett i Studio:
Image

Generert C#-modell:

[RegularExpression(@"^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$")]
[XmlElement("TestDato", Order = 4)]
[JsonProperty("TestDato")]
[JsonPropertyName("TestDato")]
public string TestDato { get; set; }
@cammiida cammiida converted this from a draft issue Dec 11, 2024
@cammiida cammiida added kind/bug Something isn't working and removed status/triage labels Dec 11, 2024
@bjosttveit
Copy link
Member

bjosttveit commented Dec 18, 2024

Dette er ikke en bug, bare dårlig design og defaults. Av en eller annen grunn lagrer Datepicker date-time som default, og man må sette "timeStamp": false eksplisitt for at den skal lagre som date.

Man forventer jo ikke at en "Date"picker skal lagre tidspunkt i det hele tatt når ikke en gang brukeren har kontroll over det, men sånn er det nå...

Sjekk: #2659

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants