bin_SCRIPTS = guestfs-browser
OCAMLPACKAGES = \
- -package libvirt,guestfs,hivex,lablgtk2,extlib,xml-light,camomile,threads,bitstring,bitstring.syntax -syntax bitstring
+ -package libvirt,guestfs,hivex,lablgtk2,extlib,xml-light,calendar,camomile,threads,bitstring,bitstring.syntax -syntax bitstring
OCAMLCFLAGS = \
-g \
-warn-error CDEFLMPSUVYZX \
AC_MSG_ERROR([Please install OCaml module 'xml-light'.])
fi
+AC_CHECK_OCAML_PKG([calendar])
+if test "$OCAML_PKG_calendar" = "no"; then
+ AC_MSG_ERROR([Please install OCaml module 'calendar'.])
+fi
+
AC_CHECK_OCAML_PKG([camomile])
if test "$OCAML_PKG_camomile" = "no"; then
AC_MSG_ERROR([Please install OCaml module 'camomile' (>= 0.8, including the data module if that is separate).])
open Printf
+module CL = CalendarLib
+
(* Base colours. XXX Should be configurable somewhere. *)
let file_color = 0x20, 0x20, 0xff (* regular file *)
let dir_color = 0x80, 0x80, 0x20 (* directory *)
let t = Int64.to_float t in
let show_full_date () =
- let tm = localtime t in
- sprintf "<span color=\"#222222\" size=\"small\">%04d-%02d-%02d %02d:%02d:%02d</span>"
- (tm.tm_year + 1900) (tm.tm_mon + 1) tm.tm_mday
- tm.tm_hour tm.tm_min tm.tm_sec
+ let cal = CL.Calendar.from_unixfloat t in
+ let cal = CL.Calendar.convert cal CL.Time_Zone.UTC CL.Time_Zone.Local in
+ CL.Printer.Calendar.sprint
+ "<span color=\"#222222\" size=\"small\">%F %T</span>" cal
in
(* How long ago? *)