Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(formula): today function, set numfmt data #1295

Merged
merged 24 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3fdffa5
feat(formula): today function, set numfmt data
Dushusir Jan 29, 2024
8b1fd3d
feat(formula): supports numfmt
Dushusir Jan 30, 2024
149152b
test(formula): set numfmt data
Dushusir Jan 30, 2024
26a9f6e
fix(formula): sum get numfmt from link cell
Dushusir Jan 30, 2024
616d6e7
fix(sheet): recover status bar
Dushusir Jan 30, 2024
8d2c5ea
fix(formula): set numfmt on formula cell
Dushusir Jan 30, 2024
8ce958c
feat(formula): date function single number
Dushusir Jan 30, 2024
9b3a463
feat(formula): date function with array
Dushusir Jan 31, 2024
4ecdf50
fix(formula): date function test, link to formatted cell supports format
Dushusir Jan 31, 2024
de9cc3e
fix(formula): date serial calculation
Dushusir Feb 3, 2024
814be41
fix(formula): function calculate null params, abs gets 0 when linked …
Dushusir Feb 3, 2024
b6cb67b
fix(formula): concatenate calculate zero value
Dushusir Feb 3, 2024
5cc3063
fix(formula): sum,max,min .etc add blank params check
Dushusir Feb 3, 2024
8aa1fb7
test(formula): new test template
Dushusir Feb 3, 2024
bb769ba
fix(formula): date function gets error when date before 1900.1.1
Dushusir Feb 3, 2024
dc4c6bd
feat(formula): add edate function
Dushusir Feb 6, 2024
df2b6ca
test(formula): test edate function
Dushusir Feb 6, 2024
7e49aea
feat(formula): year,month,day functions
Dushusir Feb 6, 2024
9598eb5
feat(formula): match, xmatch functions
Dushusir Feb 6, 2024
ba2c693
test(formula): xmatch function test case
Dushusir Feb 6, 2024
ddebc78
test(formula): nested functions test
Dushusir Feb 6, 2024
644fbb4
fix(formula): formula cell shows format, cell calculation sets percen…
Dushusir Feb 6, 2024
28e2f49
fix(formula): edate,month,year functions support blank cell
Dushusir Feb 6, 2024
38d9310
fix(formula): xmatch description
Dushusir Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(formula): edate,month,year functions support blank cell
  • Loading branch information
Dushusir committed Feb 19, 2024
commit 28e2f497b596249d10b44744dd76c43b0da19015
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('Test edate function', () => {
});
const months = new NumberValueObject(1);
const result = textFunction.calculate(startDate, months);
expect(transformToValue(result.getArrayValue())).toStrictEqual([[32, '#VALUE!', 32, '#VALUE!', '#VALUE!', '#VALUE!'], [31, 130, 33, '#VALUE!', '#NUM!', 1931]]);
expect(transformToValue(result.getArrayValue())).toStrictEqual([[32, '#VALUE!', 32, '#VALUE!', '#VALUE!', 31], [31, 130, 33, '#VALUE!', '#NUM!', 1931]]);
});

it('Months is array', () => {
Expand Down Expand Up @@ -93,7 +93,7 @@ describe('Test edate function', () => {
column: 0,
});
const result = textFunction.calculate(startDate, months);
expect(transformToValue(result.getArrayValue())).toStrictEqual([[43862, '#VALUE!', 43862, '#VALUE!', '#VALUE!', '#VALUE!'], [43831, 46874, 43891, '#VALUE!', 43739, 101660]]);
expect(transformToValue(result.getArrayValue())).toStrictEqual([[43862, '#VALUE!', 43862, '#VALUE!', '#VALUE!', 43831], [43831, 46874, 43891, '#VALUE!', 43739, 101660]]);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class Edate extends BaseFunction {
return monthsValueObject;
}

if (startDateObject.isString() || startDateObject.isNull() || startDateObject.isBoolean() || monthsValueObject.isString() || monthsValueObject.isNull() || monthsValueObject.isBoolean()) {
if (startDateObject.isString() || startDateObject.isBoolean() || monthsValueObject.isString() || monthsValueObject.isBoolean()) {
return new ErrorValueObject(ErrorType.VALUE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Test month function', () => {
column: 0,
});
const result = textFunction.calculate(serialNumber);
expect(transformToValue(result.getArrayValue())).toStrictEqual([[1, '#VALUE!', 1, 1, 1, '#VALUE!'], [1, 4, 1, '#VALUE!', '#NUM!', 3]]);
expect(transformToValue(result.getArrayValue())).toStrictEqual([[1, '#VALUE!', 1, 1, 1, 1], [1, 4, 1, '#VALUE!', '#NUM!', 3]]);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Month extends BaseFunction {
return serialNumberObject;
}

if (serialNumberObject.isString() || serialNumberObject.isNull()) {
if (serialNumberObject.isString()) {
return new ErrorValueObject(ErrorType.VALUE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Test year function', () => {
column: 0,
});
const result = textFunction.calculate(serialNumber);
expect(transformToValue(result.getArrayValue())).toStrictEqual([[1900, '#VALUE!', 1900, 1900, 1900, '#VALUE!'], [1900, 1900, 1900, '#VALUE!', '#NUM!', 1905]]);
expect(transformToValue(result.getArrayValue())).toStrictEqual([[1900, '#VALUE!', 1900, 1900, 1900, 1900], [1900, 1900, 1900, '#VALUE!', '#NUM!', 1905]]);
});
});
});
2 changes: 1 addition & 1 deletion packages/engine-formula/src/functions/date/year/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Year extends BaseFunction {
return serialNumberObject;
}

if (serialNumberObject.isString() || serialNumberObject.isNull()) {
if (serialNumberObject.isString()) {
return new ErrorValueObject(ErrorType.VALUE);
}

Expand Down