@@ -131,7 +131,11 @@ export function getFormattedRows(result: QueryResult, operations: Operation[]) {
131131 formattedRow [ column . name ] = getFormattedDate ( row [ column . name ] , granularity )
132132 }
133133
134- if ( FIELDTYPES . TEXT . includes ( column . type ) && typeof row [ column . name ] === 'string' && row [ column . name ] ) {
134+ if (
135+ FIELDTYPES . TEXT . includes ( column . type ) &&
136+ typeof row [ column . name ] === 'string' &&
137+ row [ column . name ]
138+ ) {
135139 const htmlTagRegex = / < [ ^ > ] * > / g
136140 if ( htmlTagRegex . test ( row [ column . name ] ) ) {
137141 htmlTagRegex . lastIndex = 0
@@ -146,13 +150,13 @@ export function getFormattedRows(result: QueryResult, operations: Operation[]) {
146150 } )
147151 return formattedRows
148152}
149-
150- export function getFormattedDate ( date : string , granularity : GranularityType ) {
153+ export function getFormattedDate ( date : string , granularity : string ) {
151154 if ( ! date ) return ''
155+ const fy = useSettings ( )
152156
153157 if ( granularity === 'fiscal_year' ) {
154158 const d = dayjs ( date )
155- const fiscalYearStart = useSettings ( ) . doc . fiscal_year_start || '04-01'
159+ const fiscalYearStart = fy . doc . fiscal_year_start
156160 const fiscalStartMonth = dayjs ( fiscalYearStart ) . month ( )
157161 const fiscalStartDay = dayjs ( fiscalYearStart ) . date ( )
158162
@@ -386,7 +390,10 @@ export const query_operation_types = {
386390 icon : Braces ,
387391 color : 'gray' ,
388392 class : 'text-gray-600 bg-gray-100' ,
389- init : ( args : CustomOperationArgs ) : CustomOperation => ( { type : 'custom_operation' , ...args } ) ,
393+ init : ( args : CustomOperationArgs ) : CustomOperation => ( {
394+ type : 'custom_operation' ,
395+ ...args ,
396+ } ) ,
390397 getDescription : ( op : CustomOperation ) => {
391398 return `${ op . expression . expression } `
392399 } ,
@@ -399,7 +406,7 @@ export const query_operation_types = {
399406 class : 'text-gray-600 bg-gray-100' ,
400407 init : ( args : SQLArgs ) : SQL => ( { type : 'sql' , ...args } ) ,
401408 getDescription : ( op : SQL ) => {
402- return __ ( " SQL" )
409+ return __ ( ' SQL' )
403410 } ,
404411 } ,
405412 code : {
@@ -410,7 +417,7 @@ export const query_operation_types = {
410417 class : 'text-gray-600 bg-gray-100' ,
411418 init : ( args : CodeArgs ) : Code => ( { type : 'code' , ...args } ) ,
412419 getDescription : ( op : Code ) => {
413- return __ ( " Code" )
420+ return __ ( ' Code' )
414421 } ,
415422 } ,
416423}
@@ -484,5 +491,7 @@ export function matchesFilter(value: any, parsed: ParsedFilter): boolean {
484491 }
485492 }
486493 // text: case-insensitive substring match
487- return String ( value ?? '' ) . toLowerCase ( ) . includes ( parsed . text . toLowerCase ( ) )
494+ return String ( value ?? '' )
495+ . toLowerCase ( )
496+ . includes ( parsed . text . toLowerCase ( ) )
488497}
0 commit comments