From 393fd932534bbd7f5fff0733cbae34c76607d276 Mon Sep 17 00:00:00 2001 From: xse Date: Thu, 13 Jan 2022 21:00:45 +0100 Subject: [PATCH] components/buffer: use browser locale for date-separator --- components/buffer.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/components/buffer.js b/components/buffer.js index f312c17..eaae0e1 100644 --- a/components/buffer.js +++ b/components/buffer.js @@ -527,10 +527,7 @@ class DateSeparator extends Component { render() { let date = this.props.date; - let YYYY = date.getFullYear().toString().padStart(4, "0"); - let MM = (date.getMonth() + 1).toString().padStart(2, "0"); - let DD = date.getDate().toString().padStart(2, "0"); - let text = `${YYYY}-${MM}-${DD}`; + let text = date.toLocaleDateString([], { year: "numeric", month: "2-digit", day: "2-digit" }); return html`
${text}