Skip to content

Commit

Permalink
tarih düzeltmeleri yapıldı
Browse files Browse the repository at this point in the history
  • Loading branch information
batuhan çiftçi committed May 22, 2022
1 parent 78d30b2 commit b5c0edc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions UserManagement/Models/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class User
[Required(ErrorMessage = "Phone Required!")]
public string Phone { get; set; }
[Required(ErrorMessage = "Birth Date Required!")]
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString ="{0:yyyy-MM-dd}", ApplyFormatInEditMode =true)]
public DateTime BirthDate { get; set; }
public Roles Role { get; set; }
}
Expand Down
2 changes: 1 addition & 1 deletion UserManagement/Views/Users/Create.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<div class="form-group">
@Html.LabelFor(model => model.BirthDate, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextBoxFor(model => model.BirthDate, new { @Value = DateTime.Now.ToString("yyyy/MM/dd"), @class = "form-control" })
@Html.TextBoxFor(model => model.BirthDate, new { @type = "date", @class = "form-control" })
@Html.ValidationMessageFor(model => model.BirthDate, "", new { @class = "text-danger" })
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion UserManagement/Views/Users/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<div class="form-group">
@Html.LabelFor(model => model.user.BirthDate, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.user.BirthDate.Date, new { htmlAttributes = new { @class = "form-control" } })
@Html.EditorFor(model => model.user.BirthDate, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.user.BirthDate, "", new { @class = "text-danger" })
</div>
</div>
Expand Down

0 comments on commit b5c0edc

Please sign in to comment.