DateFormat.cs 783 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using FastReport.Utils;
  5. namespace FastReport.Format
  6. {
  7. /// <summary>
  8. /// Defines how date values are formatted and displayed.
  9. /// </summary>
  10. public class DateFormat : CustomFormat
  11. {
  12. #region Public Methods
  13. /// <inheritdoc/>
  14. public override FormatBase Clone()
  15. {
  16. DateFormat result = new DateFormat();
  17. result.Format = Format;
  18. return result;
  19. }
  20. internal override string GetSampleValue()
  21. {
  22. return FormatValue(new DateTime(2007, 11, 30, 13, 30, 0));
  23. }
  24. #endregion
  25. /// <summary>
  26. /// Initializes a new instance of the <b>DateFormat</b> class with default settings.
  27. /// </summary>
  28. public DateFormat()
  29. {
  30. Format = "d";
  31. }
  32. }
  33. }