Похожие чаты

How to fix this ? The value '22/10/2020' is not valid

for Birthday.

public DateTime Birthday { get; set; }

<input id="Birthday" name="Birthday" type="text" class="form-control">

18 ответов

16 просмотров

Should you be using a text input?

Kazem- Автор вопроса
pete
Should you be using a text input?

I need to use text bcs of datetime input library

Is the birthday property part of your page model?

Kazem- Автор вопроса
Kazem- Автор вопроса
Kazem
Any way to fix ?

Use the DateTime.Parse method

I'm still not entirely sure what the problem is, but I'm willing to bet it has to do with the format. I can't do much with this. Check this out, and try a few other dates, like 11/10/2020.

Kazem- Автор вопроса
getAx
Use the DateTime.Parse method

Where ? I'm the type in viewmodel is DateTime but in view is text

Kazem- Автор вопроса
Kazem
Where ? I'm the type in viewmodel is DateTime but ...

Building on @getAx response. private DateTime _birthday; public DateTime Birthday { get => _birthday; set => _birthday = DateTime.Parse(value); } Edit: I'm having doubts about this.

Kazem- Автор вопроса
pete
Building on @getAx response. private DateTime _bi...

Looks good but how to pass it to my model ?

Kazem- Автор вопроса
Kazem
screenshot Getting error

I figured something like that might happen.

Kazem- Автор вопроса
pete
I figured something like that might happen.

how about this ? testing.. private DateTime _birthday; public string Birthday { get => _birthday.Date.ToString("dd/MM/yyyy"); set => _birthday = DateTime.ParseExact(value, "dd/MM/yyyy", CultureInfo.CurrentCulture); }

Kazem
how about this ? testing.. private DateTim...

Seems like your library is making you jump through hoops just to accommodate it. My opinion is that it would be less painful to just find a proper DateTime input library.

Kazem- Автор вопроса
pete
Seems like your library is making you jump through...

Couldnt find a simple one also bootstrap datetime isnt working (styles not applying)

Kazem- Автор вопроса

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта