Exemple #1
0
        /// <summary>
        /// Shows the only the time part of the value in both display and edit mode.
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <returns></returns>
        public static ValueTypeMetadataItemBuilder <DateTime?> FormatAsTimeOnly(this ValueTypeMetadataItemBuilder <DateTime?> instance)
        {
            Invariant.IsNotNull(instance, "instance");

            return(instance.Format("{0:t}"));
        }
Exemple #2
0
        /// <summary>
        /// Shows the value in currency format in both display and edit mode.
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <returns></returns>
        public static ValueTypeMetadataItemBuilder <decimal?> FormatAsCurrency(this ValueTypeMetadataItemBuilder <decimal?> instance)
        {
            Invariant.IsNotNull(instance, "instance");

            return(instance.Format("{0:c}"));
        }