add lower and strict year to search
This commit is contained in:
parent
9a65f2fb7e
commit
051d029c30
|
@ -268,6 +268,9 @@ export default class finder {
|
||||||
if (this.mini_arguments['lowerYear']) {
|
if (this.mini_arguments['lowerYear']) {
|
||||||
log.info('année minimale à retenir pour la sélection des dates:', this.mini_arguments['lowerYear'])
|
log.info('année minimale à retenir pour la sélection des dates:', this.mini_arguments['lowerYear'])
|
||||||
}
|
}
|
||||||
|
if (this.mini_arguments['strictYear']) {
|
||||||
|
log.info('année à retenir pour la sélection des dates:', this.mini_arguments['lowerYear'])
|
||||||
|
}
|
||||||
if (!this.mini_arguments._.length) {
|
if (!this.mini_arguments._.length) {
|
||||||
log.info('pas de fichier ou de dossier demandé, veuillez spécifier un chemin en argument')
|
log.info('pas de fichier ou de dossier demandé, veuillez spécifier un chemin en argument')
|
||||||
}
|
}
|
||||||
|
@ -520,14 +523,14 @@ export default class finder {
|
||||||
console.log('(year > 1970)', (year > 1970))
|
console.log('(year > 1970)', (year > 1970))
|
||||||
|
|
||||||
|
|
||||||
|
let strictYearToFind = 1 * this.mini_arguments['strictYear']
|
||||||
let lowerYearPossible = this.mini_arguments['lowerYear']
|
let lowerYearPossible = 1 * this.mini_arguments['lowerYear']
|
||||||
if (!lowerYearPossible) {
|
if (!lowerYearPossible) {
|
||||||
lowerYearPossible = 2004
|
lowerYearPossible = 2004
|
||||||
}
|
}
|
||||||
let today: Date = new Date();
|
let today: Date = new Date();
|
||||||
let higherYearPossible = today.getFullYear()
|
let higherYearPossible = today.getFullYear()
|
||||||
let isDateGood = (year >= lowerYearPossible) && (year <= higherYearPossible)
|
let isDateGood = (year === strictYearToFind) || ((year >= lowerYearPossible) && (year <= higherYearPossible))
|
||||||
console.log('lowerYearPossible', lowerYearPossible)
|
console.log('lowerYearPossible', lowerYearPossible)
|
||||||
if (!isDateGood) {
|
if (!isDateGood) {
|
||||||
log.warn(' date is not good :', date)
|
log.warn(' date is not good :', date)
|
||||||
|
@ -549,6 +552,8 @@ export default class finder {
|
||||||
static findEarliestDateInExifData(exifData: any) {
|
static findEarliestDateInExifData(exifData: any) {
|
||||||
log.debug(' finder - findEarliestDateInExifData')
|
log.debug(' finder - findEarliestDateInExifData')
|
||||||
|
|
||||||
|
this.moments = []
|
||||||
|
|
||||||
if (exifData) {
|
if (exifData) {
|
||||||
|
|
||||||
let exifDates: string[] = ['DateTimeOriginal', 'FileModificationDateTime', 'FileModificationDate', 'ModificationDateTime', 'ModifyDate', 'FileAccessDateTime', 'DateTime', 'FileInodeChangeDateTime', 'CreateDate']
|
let exifDates: string[] = ['DateTimeOriginal', 'FileModificationDateTime', 'FileModificationDate', 'ModificationDateTime', 'ModifyDate', 'FileAccessDateTime', 'DateTime', 'FileInodeChangeDateTime', 'CreateDate']
|
||||||
|
|
Loading…
Reference in New Issue