11import { DEFAULT_SETTINGS , FooterType } from "helpers/Constants" ;
22import { Literal } from "obsidian-dataview" ;
33import { DataviewService } from "services/DataviewService" ;
4- import { DateTime } from "luxon" ;
5- import { DbAutomationService } from "services/AutomationService" ;
4+ import { Db } from "services/CoreService" ;
65
76export default class Footer {
87 constructor ( public readonly colValues : Literal [ ] ) { }
@@ -120,7 +119,7 @@ export default class Footer {
120119 * @returns
121120 */
122121 public sum ( ) : string {
123- const total = DbAutomationService . coreFns . numbers . sum ( this . colValues ) ;
122+ const total = Db . coreFns . numbers . sum ( this . colValues ) ;
124123 return `Total: ${ total } ` ;
125124 }
126125
@@ -129,7 +128,7 @@ export default class Footer {
129128 * @returns
130129 */
131130 public min ( ) : string {
132- const min = DbAutomationService . coreFns . numbers . min ( this . colValues ) ;
131+ const min = Db . coreFns . numbers . min ( this . colValues ) ;
133132 return `Min: ${ min } ` ;
134133 }
135134
@@ -138,7 +137,7 @@ export default class Footer {
138137 * @returns
139138 */
140139 public max ( ) : string {
141- const max = DbAutomationService . coreFns . numbers . max ( this . colValues ) ;
140+ const max = Db . coreFns . numbers . max ( this . colValues ) ;
142141 return `Max: ${ max } ` ;
143142 }
144143
@@ -150,7 +149,7 @@ export default class Footer {
150149 * @returns
151150 */
152151 public earliestDate ( ) : string {
153- const earliest = DbAutomationService . coreFns . luxon . earliest ( this . colValues ) ;
152+ const earliest = Db . coreFns . luxon . earliest ( this . colValues ) ;
154153 return earliest . isValid ?
155154 `Earliest: ${ earliest . toFormat ( DEFAULT_SETTINGS . local_settings . datetime_format ) } ` :
156155 null ;
@@ -161,7 +160,7 @@ export default class Footer {
161160 * @returns
162161 */
163162 public latestDate ( ) : string {
164- const latest = DbAutomationService . coreFns . luxon . latest ( this . colValues ) ;
163+ const latest = Db . coreFns . luxon . latest ( this . colValues ) ;
165164 return latest . isValid ?
166165 `Latest: ${ latest . toFormat ( DEFAULT_SETTINGS . local_settings . datetime_format ) } ` :
167166 null ;
@@ -172,7 +171,7 @@ export default class Footer {
172171 * @returns
173172 */
174173 public rangeDate ( ) : string {
175- const range = DbAutomationService . coreFns . luxon . range ( this . colValues ) ;
174+ const range = Db . coreFns . luxon . range ( this . colValues ) ;
176175 return `Range: ${ range } days`
177176 }
178177
0 commit comments