case FMT_MONTH:
break;
+ case FMT_MTIME:
+ if (input->d)
+ output.w = MAX (input->w, input->d + 6);
+ break;
+
+ case FMT_YMDHMS:
+ if (input->w)
+ output.w = MAX (input->w, input->d + 20);
+ break;
+
default:
NOT_REACHED ();
}
return a->type == b->type && a->w == b->w && a->d == b->d;
}
-/* Adjusts FMT to be valid for a value of the given WIDTH. */
-void
+/* Adjusts FMT to be valid for a value of the given WIDTH if necessary.
+ If nothing needed to be changed the return value is false
+ */
+bool
fmt_resize (struct fmt_spec *fmt, int width)
{
if ((width > 0) != fmt_is_string (fmt->type))
else
{
/* Still numeric. */
+ return false;
}
+ return true;
}
/* Adjusts FMT's width and decimal places to be valid for USE. */
max_d = width - 21;
break;
+ case FMT_YMDHMS:
+ max_d = width - 20;
+ break;
+
+ case FMT_MTIME:
+ max_d = width - 6;
+ break;
+
case FMT_TIME:
max_d = width - 9;
break;
s2 = "dd-mmm-yyyy HH:MM:SS";
break;
+ case FMT_YMDHMS:
+ s1 = "yyyy-mm-dd HH:MM";
+ s2 = "yyyy-mm-dd HH:MM:SS";
+ break;
+
+ case FMT_MTIME:
+ s1 = "MM";
+ s2 = "MM:SS";
+ break;
+
case FMT_TIME:
s1 = "H:MM";
s2 = "H:MM:SS";
case FMT_MOYR:
case FMT_WKYR:
case FMT_DATETIME:
+ case FMT_YMDHMS:
+ case FMT_MTIME:
case FMT_TIME:
case FMT_DTIME:
case FMT_WKDAY:
}
const struct fmt_spec F_8_0 = {FMT_F, 8, 0};
+const struct fmt_spec F_8_2 = {FMT_F, 8, 2};
+const struct fmt_spec F_4_3 = {FMT_F, 4, 3};
+const struct fmt_spec F_5_1 = {FMT_F, 5, 1};