change: wip testing price from sheet
Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
parent
3b70cc9fe8
commit
07977ce896
9 changed files with 268 additions and 18 deletions
18
src/lib/helpers/formatDate.ts
Normal file
18
src/lib/helpers/formatDate.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
export function formatCustomDate(date: Date): string {
|
||||
const formatter = new Intl.DateTimeFormat('en-GB', {
|
||||
day: '2-digit',
|
||||
month: 'short',
|
||||
year: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit',
|
||||
hour12: false
|
||||
});
|
||||
|
||||
// Extract all the formatted parts into an object
|
||||
const parts = formatter.formatToParts(date);
|
||||
const partMap = Object.fromEntries(parts.map((p) => [p.type, p.value]));
|
||||
|
||||
// Construct your exact string: 16-Feb-2026 10:31:18
|
||||
return `${partMap.day}-${partMap.month}-${partMap.year} ${partMap.hour}:${partMap.minute}:${partMap.second}`;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue