https://github.com/soenneker/soenneker.blazor.dayjs
A Blazor interop library for Day.js
https://github.com/soenneker/soenneker.blazor.dayjs
blazor blazorlibrary csharp day dayjs dayjsnow dotnet interop javascript razor
Last synced: about 1 month ago
JSON representation
A Blazor interop library for Day.js
- Host: GitHub
- URL: https://github.com/soenneker/soenneker.blazor.dayjs
- Owner: soenneker
- License: mit
- Created: 2026-01-23T21:01:33.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-04-10T09:28:57.000Z (2 months ago)
- Last Synced: 2026-04-10T11:27:56.943Z (2 months ago)
- Topics: blazor, blazorlibrary, csharp, day, dayjs, dayjsnow, dotnet, interop, javascript, razor
- Language: CSS
- Homepage: https://soenneker.com
- Size: 368 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
[](https://www.nuget.org/packages/soenneker.blazor.dayjs/)
[](https://github.com/soenneker/soenneker.blazor.dayjs/actions/workflows/publish-package.yml)
[](https://www.nuget.org/packages/soenneker.blazor.dayjs/)
[](https://soenneker.github.io/soenneker.blazor.dayjs)
[](https://github.com/soenneker/soenneker.blazor.dayjs/actions/workflows/codeql.yml)
# Soenneker.Blazor.Dayjs
### Blazor interop for Day.js
A lightweight Blazor interop library for [Day.js](https://day.js.org/) focused on **live, auto-updating time displays**.
---
## Installation
```bash
dotnet add package Soenneker.Blazor.Dayjs
````
---
## Setup
Register the service:
```csharp
builder.Services.AddDayJsInteropAsScoped();
```
Add a using:
```razor
@using Soenneker.Blazor.Dayjs
```
---
## Components
### Live relative time
```razor
```
---
### Live clock
Uses .NET date/time format strings.
```razor
```
---
### Countdown / time until
Uses .NET `TimeSpan` format strings.
```razor
```
---
## Configuration
Day.js plugins are loaded explicitly.
```razor
@using Soenneker.Blazor.Dayjs.Configuration
@inject IDayJsInterop DayJsInterop
```
```csharp
await DayJsInterop.Initialize(new DayJsOptions
{
UseCdn = true,
LoadRelativeTime = true,
LoadTimezone = true,
LoadUtc = true,
LoadDuration = true
});
```