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 edda9a2773 refactor(temporal)!: cleaned up organization 2023-01-16 13:45:59 -06:00
..
Cli refactor!: fixed missed namespaces 2023-01-14 18:19:42 -06:00
Setup refactor(temporal)!: cleaned up organization 2023-01-16 13:45:59 -06:00
Validators refactor(temporal)!: cleaned up organization 2023-01-16 13:45:59 -06:00
CanExpire.cs refactor: renaming namespaces 2022-09-06 00:53:22 -05:00
CreateDateIndexes.cs refactor!: moving generator attributes into Nitride.Generators namespace 2023-01-15 14:08:58 -06:00
DateIndex.cs refactor: renaming namespaces 2022-09-06 00:53:22 -05:00
FilterOutExpiredInstant.cs refactor!: moving generator attributes into Nitride.Generators namespace 2023-01-15 14:08:58 -06:00
FilterOutFutureInstant.cs refactor!: moving generator attributes into Nitride.Generators namespace 2023-01-15 14:08:58 -06:00
MfGames.Nitride.Temporal.csproj refactor(temporal)!: cleaned up organization 2023-01-16 13:45:59 -06:00
NitrideTemporalModule.cs refactor: renaming namespaces 2022-09-06 00:53:22 -05:00
README.md feat!: renaming files and projects 2022-09-06 00:40:00 -05:00
SetInstantFromComponent.cs refactor(temporal)!: cleaned up organization 2023-01-16 13:45:59 -06:00
SetInstantFromPath.cs refactor!: moving generator attributes into Nitride.Generators namespace 2023-01-15 14:08:58 -06:00
Timekeeper.cs refactor: renaming namespaces 2022-09-06 00:53:22 -05: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())