-
Notifications
You must be signed in to change notification settings - Fork 236
Closed
US-EPA-CAMD/easey-quartz-scheduler
#284Description
Hi,
In handlebars.js one can create a helper that returns a complex object to be used by other helpers like so:
Handlebars.registerHelper("now", () => {
return new Date(); // Returns a complex object, not a string
});
Handlebars.registerHelper("format", (value) => {
if (value instanceof Date) {
// This is the complex Date object, format as date
return Handlebars.SafeString(value.valueOf());
else {
// This is not a Date object
return Handlebars.SafeString("not a date");
}
});
In the template I have something like {{format (now)}}. This works in handlebars.js, but I cannot figure out how to do it in .NET land. I don't want to write (serialize) the object in now() and then deserialize it again in format().
Any suggestions?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels