-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add warning to merge collections - Change format of date tag in save tabs
- Loading branch information
Rustem Mussabekov
committed
Feb 18, 2025
1 parent
6111f42
commit 94ce852
Showing
10 changed files
with
50 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react' | ||
import { parseDate } from './parse' | ||
import dateFnsFormat from 'date-fns/format' | ||
|
||
let _format | ||
function getFormat() { | ||
if (!_format) | ||
_format = new Intl.DateTimeFormat( | ||
undefined, | ||
{ | ||
year: 'numeric', | ||
month: 'numeric', | ||
day: 'numeric', | ||
} | ||
).format | ||
|
||
return _format | ||
} | ||
|
||
export const numericDate = (original) => { | ||
let d | ||
try{ d = parseDate(original) } catch(e){} | ||
|
||
try{ | ||
return getFormat()(d) | ||
}catch(e){} | ||
|
||
try{ | ||
return dateFnsFormat(d, 'P') | ||
}catch(e){} | ||
|
||
return '' | ||
} | ||
|
||
export const NumericDate = React.memo( | ||
function({ date }) { | ||
return numericDate(date) | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters