chore: remove redunant electronVersion from desktop build params
This commit is contained in:
@@ -80,7 +80,6 @@
|
|||||||
"webpack-merge": "^5.8.0"
|
"webpack-merge": "^5.8.0"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"electronVersion": "17.4.2",
|
|
||||||
"appId": "org.standardnotes.standardnotes",
|
"appId": "org.standardnotes.standardnotes",
|
||||||
"artifactName": "standard-notes-${version}-${os}-${arch}.${ext}",
|
"artifactName": "standard-notes-${version}-${os}-${arch}.${ext}",
|
||||||
"afterSign": "scripts/notarizeMac.js",
|
"afterSign": "scripts/notarizeMac.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { dateFromDSLDateString } from './Utils'
|
import { dateFromDSLDateString } from './Utils'
|
||||||
import { addDaysToDate, addHoursToDate } from '@standardnotes/utils'
|
import { addDaysToDate, addHoursToDate, addMonthsToDate, addYearsToDate } from '@standardnotes/utils'
|
||||||
|
|
||||||
describe('Predicate Utils', () => {
|
describe('Predicate Utils', () => {
|
||||||
describe('dateFromDSLDateString', () => {
|
describe('dateFromDSLDateString', () => {
|
||||||
@@ -15,12 +15,12 @@ describe('Predicate Utils', () => {
|
|||||||
|
|
||||||
it('should return a date object with the correct month', () => {
|
it('should return a date object with the correct month', () => {
|
||||||
const date = dateFromDSLDateString('1.months.ago')
|
const date = dateFromDSLDateString('1.months.ago')
|
||||||
expect(date.getMonth()).toEqual(new Date().getMonth() - 1)
|
expect(date.getMonth()).toEqual(addMonthsToDate(new Date(), -1).getMonth())
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return a date object with the correct year', () => {
|
it('should return a date object with the correct year', () => {
|
||||||
const date = dateFromDSLDateString('1.years.ago')
|
const date = dateFromDSLDateString('1.years.ago')
|
||||||
expect(date.getFullYear()).toEqual(new Date().getFullYear() - 1)
|
expect(date.getFullYear()).toEqual(addYearsToDate(new Date(), -1).getFullYear())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
export function addHoursToDate(date: Date, hours: number) {
|
||||||
|
const result = new Date(date)
|
||||||
|
result.setHours(result.getHours() + hours)
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
/** Negative numbers are supported as well */
|
/** Negative numbers are supported as well */
|
||||||
export function addDaysToDate(date: Date, days: number) {
|
export function addDaysToDate(date: Date, days: number) {
|
||||||
const result = new Date(date)
|
const result = new Date(date)
|
||||||
@@ -6,9 +13,16 @@ export function addDaysToDate(date: Date, days: number) {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
export function addHoursToDate(date: Date, hours: number) {
|
export function addMonthsToDate(date: Date, months: number) {
|
||||||
const result = new Date(date)
|
const result = new Date(date)
|
||||||
result.setHours(result.getHours() + hours)
|
result.setMonth(result.getMonth() + months)
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addYearsToDate(date: Date, years: number) {
|
||||||
|
const result = new Date(date)
|
||||||
|
result.setFullYear(result.getFullYear() + years)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user