chore: remove redunant electronVersion from desktop build params

This commit is contained in:
Mo
2023-01-02 23:26:15 -06:00
parent c0a0ea185c
commit a896b4d9cf
3 changed files with 19 additions and 6 deletions

View File

@@ -80,7 +80,6 @@
"webpack-merge": "^5.8.0"
},
"build": {
"electronVersion": "17.4.2",
"appId": "org.standardnotes.standardnotes",
"artifactName": "standard-notes-${version}-${os}-${arch}.${ext}",
"afterSign": "scripts/notarizeMac.js",

View File

@@ -1,5 +1,5 @@
import { dateFromDSLDateString } from './Utils'
import { addDaysToDate, addHoursToDate } from '@standardnotes/utils'
import { addDaysToDate, addHoursToDate, addMonthsToDate, addYearsToDate } from '@standardnotes/utils'
describe('Predicate Utils', () => {
describe('dateFromDSLDateString', () => {
@@ -15,12 +15,12 @@ describe('Predicate Utils', () => {
it('should return a date object with the correct month', () => {
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', () => {
const date = dateFromDSLDateString('1.years.ago')
expect(date.getFullYear()).toEqual(new Date().getFullYear() - 1)
expect(date.getFullYear()).toEqual(addYearsToDate(new Date(), -1).getFullYear())
})
})
})

View File

@@ -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 */
export function addDaysToDate(date: Date, days: number) {
const result = new Date(date)
@@ -6,9 +13,16 @@ export function addDaysToDate(date: Date, days: number) {
return result
}
export function addHoursToDate(date: Date, hours: number) {
export function addMonthsToDate(date: Date, months: number) {
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
}