Answers for "Handlebars c# datetime now"

C#
0

Handlebars c# datetime now

Handlebars.RegisterHelper(DateFormat, (output, context, data) => 
            {
                DateTime.TryParse(data[0].ToString(), out DateTime date);

                var dictionary = data[1] as HandlebarsDotNet.Compiler.HashParameterDictionary;
                var formatString = dictionary["formatString"];

                output.WriteSafeString(date.ToString(formatString.ToString()));
            });
Posted by: Guest on August-24-2021

C# Answers by Framework

Browse Popular Code Answers by Language