WIP: Changes main page to not include sidebar, that moves to project view.
This commit is contained in:
20
Sources/Styleguide/Date.swift
Normal file
20
Sources/Styleguide/Date.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
import Elementary
|
||||
import Foundation
|
||||
|
||||
public struct DateView: HTML, Sendable {
|
||||
let date: Date
|
||||
|
||||
var formatter: DateFormatter {
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateStyle = .short
|
||||
return formatter
|
||||
}
|
||||
|
||||
public init(_ date: Date) {
|
||||
self.date = date
|
||||
}
|
||||
|
||||
public var body: some HTML<HTMLTag.span> {
|
||||
span { formatter.string(from: date) }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user