DateFunctions.cs 710 B

123456789101112131415161718
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace InABox.Core
  5. {
  6. internal static class DateFunctions
  7. {
  8. public const string GROUP = "Date";
  9. public static void Register()
  10. {
  11. CoreExpression.RegisterFunction("Now", "Returns the current date and time.", GROUP, new string[] {}, (p, vars, c) => DateTime.Now);
  12. CoreExpression.RegisterFunction("Today", "Returns the current date.", GROUP, new string[] {}, (p, vars, c) => DateTime.Today);
  13. CoreExpression.RegisterFunction("DateTime_MinValue", "Returns the minimum value for a date and time.", GROUP, new string[] {}, (p, vars, c) => DateTime.MinValue);
  14. }
  15. }
  16. }