Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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()));
            });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Handlebars #datetime
ADD COMMENT
Topic
Name
6+2 =