This page permanently redirects to gemini://mfgames.com/mfgames-cil/docs/nitride/temporal/.

MfGames.Nitride.Temporal

=> Up a Level

The package MfGames.Nitride.Temporal extends Nitride with time- and date-centric operations, extensions, and processes. It allows a site to be hide future posts, create a calendar of entries, or create a nested set of pages based on year, month, and day.

dotnet add package MfGames.Nitride.Temporal

This also has an extension method to include it into the builder.

        public static async Task Main(string[] args)
        {
            NitrideBuilder builder = new NitrideBuilder(args)
                .UseTemporal(
                    config =>
                    {
                        config
                            .WithDateTimeZone("America/Chicago")
                            .WithDateOptionCommandLineOption();
                    });

            return await builder.RunAsync();
        }

NodaTime and Instants

This library is built on top of NodaTime[1], provides good time zone support, and had date-only objects before they were available in the base library.

=> 1: https://nodatime.org/

In most cases, adding an Instant to an entity is sufficient to use most of the temporal functionality.

Instant instant;

var entityList = new Entity[]
{
    new Entity(instant),
};

var op = context.Resolve();

var filteredList = entityList.Run(op).ToList();

Options

When the WithDateOptionCommandLineOption() is included in the module setup, it injects a --date option into the builders that allows a different date to be used for the “now” date which can be retrieved from the injectable TimeService as CurrentInstant and CurrentDateTime.

Examples

=> Create an iCalendar File | Removing Future Entities

Footer

Below are various useful links within this site and to related sites (not all have been converted over to Gemini).

=> Categories

=> D. Moonfire | Fedran | The Moonfires

=> HTML

Proxy Information
Original URL
gemini://mfgames.com/mfgames-cil/docs/nitride/temporal
Status Code
Success (20)
Meta
text/gemini;lang=en-US
Capsule Response Time
998.093367 milliseconds
Gemini-to-HTML Time
0.697408 milliseconds

This content has been proxied by September (ba2dc).