Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/spa-templates.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Sanderson <SteveSandersonMS@users.noreply.github.com>2022-08-03 18:27:49 +0300
committerSteve Sanderson <SteveSandersonMS@users.noreply.github.com>2022-08-04 15:51:50 +0300
commit3aaaa4155cb2ec473f2eadda85bbc15703ce76a6 (patch)
tree54504f3963818cc6205c49d3a20c2ee02145f901
parentea70568ba0bd91a349874cb8936d5de6d61e986b (diff)
On FetchData pages, show date only (not time). Fixes https://github.com/dotnet/aspnetcore/issues/42345
-rw-r--r--src/content/Angular-CSharp/Controllers/WeatherForecastController.cs2
-rw-r--r--src/content/Angular-CSharp/WeatherForecast.cs2
-rw-r--r--src/content/React-CSharp/ClientApp/src/components/FetchData.js2
-rw-r--r--src/content/React-CSharp/Controllers/WeatherForecastController.cs2
-rw-r--r--src/content/React-CSharp/WeatherForecast.cs2
5 files changed, 5 insertions, 5 deletions
diff --git a/src/content/Angular-CSharp/Controllers/WeatherForecastController.cs b/src/content/Angular-CSharp/Controllers/WeatherForecastController.cs
index 06c83ba..219983c 100644
--- a/src/content/Angular-CSharp/Controllers/WeatherForecastController.cs
+++ b/src/content/Angular-CSharp/Controllers/WeatherForecastController.cs
@@ -29,7 +29,7 @@ public class WeatherForecastController : ControllerBase
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
- Date = DateTime.Now.AddDays(index),
+ Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
diff --git a/src/content/Angular-CSharp/WeatherForecast.cs b/src/content/Angular-CSharp/WeatherForecast.cs
index 79d043e..f185c90 100644
--- a/src/content/Angular-CSharp/WeatherForecast.cs
+++ b/src/content/Angular-CSharp/WeatherForecast.cs
@@ -2,7 +2,7 @@ namespace Company.WebApplication1;
public class WeatherForecast
{
- public DateTime Date { get; set; }
+ public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
diff --git a/src/content/React-CSharp/ClientApp/src/components/FetchData.js b/src/content/React-CSharp/ClientApp/src/components/FetchData.js
index ab4115f..1b9d68d 100644
--- a/src/content/React-CSharp/ClientApp/src/components/FetchData.js
+++ b/src/content/React-CSharp/ClientApp/src/components/FetchData.js
@@ -17,7 +17,7 @@ export class FetchData extends Component {
static renderForecastsTable(forecasts) {
return (
- <table className='table table-striped' aria-labelledby="tableLabel">
+ <table className="table table-striped" aria-labelledby="tableLabel">
<thead>
<tr>
<th>Date</th>
diff --git a/src/content/React-CSharp/Controllers/WeatherForecastController.cs b/src/content/React-CSharp/Controllers/WeatherForecastController.cs
index 06c83ba..219983c 100644
--- a/src/content/React-CSharp/Controllers/WeatherForecastController.cs
+++ b/src/content/React-CSharp/Controllers/WeatherForecastController.cs
@@ -29,7 +29,7 @@ public class WeatherForecastController : ControllerBase
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
- Date = DateTime.Now.AddDays(index),
+ Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
diff --git a/src/content/React-CSharp/WeatherForecast.cs b/src/content/React-CSharp/WeatherForecast.cs
index 79d043e..f185c90 100644
--- a/src/content/React-CSharp/WeatherForecast.cs
+++ b/src/content/React-CSharp/WeatherForecast.cs
@@ -2,7 +2,7 @@ namespace Company.WebApplication1;
public class WeatherForecast
{
- public DateTime Date { get; set; }
+ public DateOnly Date { get; set; }
public int TemperatureC { get; set; }