Fixed date scanning for whatsapp and google images
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
33b8c0a65b
commit
588a261796
@ -36,6 +36,7 @@
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
font-size: 0.6em;
|
||||
}
|
||||
|
||||
:host:hover > div {
|
||||
|
@ -363,17 +363,16 @@ function triggerWatcher() {
|
||||
}
|
||||
} else {
|
||||
/* Attempt to infer the datestamp from the filename */
|
||||
let patterns = /WhatsApp Image (20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]) at (.*).(jpeg|jpg)/;
|
||||
let date = moment(created).format();
|
||||
let match = file.match(patterns);
|
||||
|
||||
let match = file.match(/WhatsApp Image (20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]) at (.*).(jpeg|jpg)/);
|
||||
if (match) {
|
||||
date = moment((match[1]+" "+match[2]), "YYYY-MM-DD h.mm.ss a").format();
|
||||
if (date == "Invalid date") {
|
||||
date = moment(created).format();
|
||||
}
|
||||
} else {
|
||||
patterns = /(20[0-9][0-9]-?[0-9][0-9]-?[0-9][0-9])[_\-]?([0-9]{6})?/;
|
||||
match = file.match(patterns);
|
||||
match = file.match(/(20[0-9][0-9]-?[0-9][0-9]-?[0-9][0-9])[_\-]?([0-9]{6})?/);
|
||||
if (match) {
|
||||
if (match[2]) { /* Stamp had time in it */
|
||||
date = moment((match[1]+""+match[2]).replace(/-/g, ""), "YYYYMMDDHHmmss").format();
|
||||
|
Loading…
x
Reference in New Issue
Block a user