This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
mfgames-nitride-cil/src/MfGames.Nitride.Temporal
D. Moonfire 22ddae11f8
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/tag/woodpecker Pipeline was successful Details
fix(temporal): added CurrentInstant and CurrentDateTime to TimeService
2023-01-21 17:48:39 -06:00
..
Cli refactor(temporal)!: renamed Timekeeper to TimeService 2023-01-21 01:52:52 -06:00
Setup refactor(temporal)!: renamed Timekeeper to TimeService 2023-01-21 01:52:52 -06:00
Validators refactor(temporal)!: renamed Timekeeper to TimeService 2023-01-21 01:52:52 -06:00
CanExpire.cs feat(schedules): implemented the basic schedule 2023-01-16 22:10:24 -06:00
CreateDateIndexes.cs refactor(temporal)!: renamed Timekeeper to TimeService 2023-01-21 01:52:52 -06:00
DateIndex.cs refactor: renaming namespaces 2022-09-06 00:53:22 -05:00
FilterOutExpiredInstant.cs refactor(temporal)!: renamed Timekeeper to TimeService 2023-01-21 01:52:52 -06:00
FilterOutFutureInstant.cs refactor(temporal)!: renamed Timekeeper to TimeService 2023-01-21 01:52:52 -06:00
MfGames.Nitride.Temporal.csproj refactor(temporal)!: renamed Timekeeper to TimeService 2023-01-21 01:52:52 -06:00
README.md feat!: renaming files and projects 2022-09-06 00:40:00 -05:00
SetInstantFromComponent.cs refactor(temporal)!: renamed Timekeeper to TimeService 2023-01-21 01:52:52 -06:00
SetInstantFromPath.cs refactor(temporal)!: renamed Timekeeper to TimeService 2023-01-21 01:52:52 -06:00
TimeService.cs fix(temporal): added CurrentInstant and CurrentDateTime to TimeService 2023-01-21 17:48:39 -06:00

README.md

Date Processing

One of the common features of static websites are blogs which leads to having some form of date-centric processing of pages to build archive pages, calendars, and being able to write posts in the future.

With the component system, the date of a given file is simply attached to Nodatime.Instant component of the Entity object for the bulk of the processing.

Supporting Time Zones

The concept of time zones while date processing is one that is frequently overlooked. A date is a date, right? However, most blogs and news sites have a concept of when a new day starts but it isn't always the same time as the server that is building the site. While a blog might be in America/Chicago time, a CI server could be set to UTC (such as Azure build servers) and the "day" may roll over fix or six hours before or after the blog's time.

This is why Nitride uses Instant for when pages are implemented. These are points in time that are independent of time zones, but we also provide tools for converting a date model or one from the path into a proper instant based on the blog's time zone.

Why NodaTime?

We decided to use NodaTime instead of the built-in date time functions for a number of reasons, mainly because it has a more intuitive way of handling time zones

Configuring

There are two callbacks on NitrideBuilder that can be used to define the date and time processing for the blog.

NitrideBuilder builder;

builder
    .ConfigureDates((NitrideClock clock) => clock.SetTimeZone())