Skip to content

Commit

Permalink
More to #10
Browse files Browse the repository at this point in the history
  • Loading branch information
nheath99 committed Oct 5, 2018
1 parent 99dc7c4 commit a9e5fc1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,23 @@ Until the issue https://github.com/aspnet/Blazor/issues/1315 is resolved, insert

@addTagHelper *, BlazorNodaTimeDateTimePicker

### Inline

To display a simple inline DatePicker, use the following code:

<DatePicker Inline=true>

![DatePicker1](/docs/images/DatePicker1.png)

### Localization

Display day and month names in the specified culture:

<DatePicker Inline=true FormatProvider="@(new System.Globalization.CultureInfo("fr-FR"))"/>

![DatePicker1](/docs/images/DatePicker_Localization.png)
![DatePicker1](/docs/images/DatePicker_Localization_Months.png)

## Help Wanted!
Get in touch if you want to collaborate!!

Expand Down
Binary file added docs/images/DatePicker_Localization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/DatePicker_Localization_Months.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 21 additions & 2 deletions src/BlazorNodaTimeDateTimePicker.Demo/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@
<hr />
<h3>Localisation</h3>

<div class="d-flex flex-sm-row flex-column">
<div class="mr-3">
<DatePicker Inline=true FormatProvider=@formatProvider5/>
</div>
<p>
<select bind=@formatProvider5String>
<option selected value="fr-FR">fr-FR</option>
<option value="en-GB">en-GB</option>
</select>
</p>
</div>

<hr />
<h3>Selected Date</h3>

Expand Down Expand Up @@ -171,6 +183,13 @@
StateHasChanged();
}
IsoDayOfWeek firstDOW3 = IsoDayOfWeek.Tuesday;

bool displayDOW4 = false;

bool displayDOW4 = false;

string formatProvider5String
{
get => formatProvider5.DisplayName;
set => formatProvider5 = new System.Globalization.CultureInfo(value);
}
System.Globalization.CultureInfo formatProvider5 = new System.Globalization.CultureInfo("fr-FR");
}

0 comments on commit a9e5fc1

Please sign in to comment.