mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 14:33:47 +00:00
fix datetime-local input type
This commit is contained in:
@@ -46,14 +46,16 @@ pub const Type = enum {
|
|||||||
range,
|
range,
|
||||||
date,
|
date,
|
||||||
time,
|
time,
|
||||||
datetime_local,
|
@"datetime-local",
|
||||||
month,
|
month,
|
||||||
week,
|
week,
|
||||||
color,
|
color,
|
||||||
|
|
||||||
pub fn fromString(str: []const u8) Type {
|
pub fn fromString(str: []const u8) Type {
|
||||||
// Longest type name is "datetime-local" at 14 chars
|
// Longest type name is "datetime-local" at 14 chars
|
||||||
if (str.len > 32) return .text;
|
if (str.len > 32) {
|
||||||
|
return .text;
|
||||||
|
}
|
||||||
|
|
||||||
var buf: [32]u8 = undefined;
|
var buf: [32]u8 = undefined;
|
||||||
const lower = std.ascii.lowerString(&buf, str);
|
const lower = std.ascii.lowerString(&buf, str);
|
||||||
@@ -61,10 +63,7 @@ pub const Type = enum {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn toString(self: Type) []const u8 {
|
pub fn toString(self: Type) []const u8 {
|
||||||
return switch (self) {
|
return @tagName(self);
|
||||||
.datetime_local => "datetime-local",
|
|
||||||
else => @tagName(self),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user