tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
open calendars to corrent months and times by default
cozylittle.house
1 month ago
f0d30124
6842b627
+3
-2
2 changed files
expand all
collapse all
unified
split
app
[leaflet_id]
publish
PublishPost.tsx
components
DatePicker.tsx
+2
-2
app/[leaflet_id]/publish/PublishPost.tsx
···
251
251
);
252
252
253
253
const [timeValue, setTimeValue] = useState<string>(() => {
254
254
-
if (!props.publishedAt) return "12:00";
255
255
-
return `${props.publishedAt.getHours().toString().padStart(2, "0")}:${props.publishedAt.getMinutes().toString().padStart(2, "0")}`;
254
254
+
const date = props.publishedAt || new Date();
255
255
+
return `${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}`;
256
256
});
257
257
258
258
let currentTime = `${new Date().getHours().toString().padStart(2, "0")}:${new Date().getMinutes().toString().padStart(2, "0")}`;
+1
components/DatePicker.tsx
···
44
44
}}
45
45
mode="single"
46
46
selected={selected}
47
47
+
defaultMonth={selected}
47
48
onSelect={onSelect}
48
49
disabled={disabled}
49
50
/>