srctree

Gregory Mullen parent d8da2368 2811e166
add some padding to journal

src/datetime.zig added: 32, removed: 25, total 7
@@ -1,4 +1,5 @@
const std = @import("std");
const eql = std.mem.eql;
 
const DateTime = @This();
 
@@ -166,23 +167,22 @@ pub fn fromEpochTzStr(str: []const u8, tzstr: []const u8) !DateTime {
}
 
pub fn format(self: DateTime, comptime fstr: []const u8, _: std.fmt.FormatOptions, out: anytype) !void {
if (comptime std.mem.eql(u8, fstr, "dtime")) {
return out.print("{s} {:0>2}:{:0>2}:{:0>2}", .{
WEEKDAYS[self.weekday],
self.hours,
self.minutes,
self.seconds,
});
if (comptime eql(u8, fstr, "dtime")) {
return out.print(
"{s} {:0>2}:{:0>2}:{:0>2}",
.{ WEEKDAYS[self.weekday], self.hours, self.minutes, self.seconds },
);
} else if (comptime eql(u8, fstr, "day")) {
return out.print("{s}", .{WEEKDAYS[self.weekday]});
} else if (comptime eql(u8, fstr, "time") or eql(u8, fstr, "HH:mm:ss")) {
return out.print("{:0>2}:{:0>2}:{:0>2}", .{ self.hours, self.minutes, self.seconds });
} else if (comptime eql(u8, fstr, "Y-m-d")) {
return out.print("{}-{}-{}", .{ self.years, self.months, self.days });
}
return out.print("{}-{}-{} {s} {:0>2}:{:0>2}:{:0>2}", .{
self.years,
self.months,
self.days,
WEEKDAYS[self.weekday],
self.hours,
self.minutes,
self.seconds,
});
return out.print(
"{}-{}-{} {s} {:0>2}:{:0>2}:{:0>2}",
.{ self.years, self.months, self.days, WEEKDAYS[self.weekday], self.hours, self.minutes, self.seconds },
);
}
 
test "now" {
 
src/endpoints/commit-flex.zig added: 32, removed: 25, total 7
@@ -28,7 +28,11 @@ const Scribe = struct {
try jctx.put("Name", self.name);
try jctx.put("Repo", self.repo);
try jctx.put("Title", self.title);
try jctx.put("Date", try std.fmt.allocPrint(a, "{}", .{self.date}));
try jctx.put("Date", try std.fmt.allocPrint(
a,
"<span>{Y-m-d}</span><span>{day}</span><span>{time}</span>",
.{ self.date, self.date, self.date },
));
try jctx.put("ShaLong", self.sha);
try jctx.put("Sha", self.sha[0..8]);
return jctx;
 
static/main.css added: 32, removed: 25, total 7
@@ -578,7 +578,7 @@ blob {
journal {
display: flex;
justify-content: space-between;
 
span { padding: 0 0.3rem; }
}
 
.commit-flex {
 
templates/user_commits.html added: 32, removed: 25, total 7
@@ -32,9 +32,12 @@
<Lead ORNULL>
<For Rows>
<journal>
<span><Sha>: <Title></span>
<span>in <Repo> on <Date></span>
<!--span><Sha></span-->
<span><Sha>: <Title></span>
<span>
<span>in <Repo></span>
<span>on <Date></span>
</span>
<!--span><Sha></span-->
</journal>
</For>
</div>