Skip to content

Commit

Permalink
feat(quoteSummary)!: unify date format (#264)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: use `date` instead of `number` for various fields.
The original use of `number` was unintentional.  This commit fixes that.
Unfortunately the type change is a breaking change.

* docs: add insiderTransaction example
* docs: add insiderHolders example
* docs: add netSharePurchaseActivity example
* docs: add institutionOwnership example
* docs: add cashflowStatementHistoryQuarterly example
* docs: add fundOwnership example
* docs: add incomeStatementHistory example
* docs: add incomeStatementHistoryQuarterly example
* docs: add indexTrend example
* docs: add industryTrend example
* docs: add majorDirectHolders example
* docs: add majorHoldersBreakdown example
* docs: add quoteType example
* docs: add recommendationTrend example
* docs: add sectorTrend example
* docs: add fundPerformance example
* docs: add fundProfile example
* docs: add missing symbols in example request
* docs: correct example response
* docs: correct defaultKeyStatistics example
* docs: align date format
* feat(#263): replace timestamps with date objects
* docs(#263): update docs according to new date format
  • Loading branch information
nicogenz committed Oct 24, 2021
1 parent 0961e83 commit 4cf1f62
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 34 deletions.
28 changes: 14 additions & 14 deletions docs/modules/quoteSummary.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@ await yahooFinance.quoteSummary('PLTR', { modules: [ "defaultKeyStatistics" ] })
"floatShares": 1513962964,
"sharesOutstanding": 1805229952,
"sharesShort": 58395451,
"sharesShortPriorMonth": 68132010,
"sharesShortPreviousMonthDate": 1625011200,
"dateShortInterest": 1627603200,
"sharesShortPriorMonth": new Date("1972-02-28T13:33:30.000Z"),
"sharesShortPreviousMonthDate": new Date("2021-06-30T00:00:00.000Z"),
"dateShortInterest": new Date("2021-07-30T00:00:00.000Z"),
"sharesPercentSharesOut": 0.0311,
"heldPercentInsiders": 0.12776,
"heldPercentInstitutions": 0.25067,
Expand All @@ -412,9 +412,9 @@ await yahooFinance.quoteSummary('PLTR', { modules: [ "defaultKeyStatistics" ] })
"priceToBook": 23.314608,
"fundFamily": null,
"legalType": null,
"lastFiscalYearEnd": 1609372800,
"nextFiscalYearEnd": 1672444800,
"mostRecentQuarter": 1625011200,
"lastFiscalYearEnd": new Date("2020-12-31T00:00:00.000Z"),
"nextFiscalYearEnd": new Date("2022-12-31T00:00:00.000Z"),
"mostRecentQuarter": new Date("2021-06-30T00:00:00.000Z"),
"netIncomeToCommon": -1263715968,
"trailingEps": -0.79,
"pegRatio": 3.58,
Expand Down Expand Up @@ -485,13 +485,13 @@ await yahooFinance.quoteSummary('MSFT', { modules: [ "earningsHistory" ] });
earningsHistory: {
history: [
{
maxAge: 1,
epsActual: 1.4,
epsEstimate: 1.26,
epsDifference: 0.14,
surprisePercent: 0.111,
quarter: 1585612800,
period: '-4q' // "-3q", "-2q", "-1q"
"maxAge": 1,
"epsActual": 10.3,
"epsEstimate": 1.46,
"epsDifference": 8.84,
"surprisePercent": 6.055,
"quarter": new Date("2020-06-30T00:00:00.000Z"),
"period": "-4q" // "-3q", "-2q", "-1q"
},
/* ... */
],
Expand Down Expand Up @@ -880,7 +880,7 @@ await yahooFinance.quoteSummary('PLTR', { modules: [ "insiderHolders" ] });
"transactionDescription": "Sale",
"latestTransDate": new Date("2021-07-23T00:00:00.000Z"),
"positionDirect": 6432260,
"positionDirectDate": 1626998400
"positionDirectDate": new Date("2021-07-23T00:00:00.000Z")
},
/* ... */
],
Expand Down
27 changes: 17 additions & 10 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3973,13 +3973,13 @@
"yahooFinanceType": "number"
},
"sharesShortPriorMonth": {
"yahooFinanceType": "number"
"yahooFinanceType": "date"
},
"sharesShortPreviousMonthDate": {
"yahooFinanceType": "number"
"yahooFinanceType": "date"
},
"dateShortInterest": {
"yahooFinanceType": "number"
"yahooFinanceType": "date"
},
"sharesPercentSharesOut": {
"yahooFinanceType": "number"
Expand Down Expand Up @@ -4027,13 +4027,13 @@
]
},
"lastFiscalYearEnd": {
"yahooFinanceType": "number"
"yahooFinanceType": "date"
},
"nextFiscalYearEnd": {
"yahooFinanceType": "number"
"yahooFinanceType": "date"
},
"mostRecentQuarter": {
"yahooFinanceType": "number"
"yahooFinanceType": "date"
},
"earningsQuarterlyGrowth": {
"yahooFinanceType": "number"
Expand Down Expand Up @@ -4075,7 +4075,7 @@
"yahooFinanceType": "number"
},
"lastDividendDate": {
"yahooFinanceType": "number"
"yahooFinanceType": "date"
},
"ytdReturn": {
"yahooFinanceType": "number"
Expand Down Expand Up @@ -4298,7 +4298,14 @@
"yahooFinanceType": "number|null"
},
"quarter": {
"yahooFinanceType": "number|null"
"anyOf": [
{
"yahooFinanceType": "date"
},
{
"type": "null"
}
]
},
"period": {
"type": "string"
Expand Down Expand Up @@ -5341,13 +5348,13 @@
"yahooFinanceType": "number"
},
"positionDirectDate": {
"yahooFinanceType": "number"
"yahooFinanceType": "date"
},
"positionIndirect": {
"yahooFinanceType": "number"
},
"positionIndirectDate": {
"yahooFinanceType": "number"
"yahooFinanceType": "date"
},
"positionSummaryDate": {
"yahooFinanceType": "date"
Expand Down
20 changes: 10 additions & 10 deletions src/modules/quoteSummary-iface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ export interface DefaultKeyStatistics {
floatShares?: number;
sharesOutstanding?: number;
sharesShort?: number;
sharesShortPriorMonth?: number;
sharesShortPreviousMonthDate?: number;
dateShortInterest?: number;
sharesShortPriorMonth?: Date;
sharesShortPreviousMonthDate?: Date;
dateShortInterest?: Date;
sharesPercentSharesOut?: number;
heldPercentInsiders?: number;
heldPercentInstitutions?: number;
Expand All @@ -199,9 +199,9 @@ export interface DefaultKeyStatistics {
priceToBook?: number;
fundFamily: null | string;
legalType: null | string;
lastFiscalYearEnd?: number;
nextFiscalYearEnd?: number;
mostRecentQuarter?: number;
lastFiscalYearEnd?: Date;
nextFiscalYearEnd?: Date;
mostRecentQuarter?: Date;
earningsQuarterlyGrowth?: number;
netIncomeToCommon?: number;
trailingEps?: number;
Expand All @@ -214,7 +214,7 @@ export interface DefaultKeyStatistics {
"52WeekChange"?: number;
SandP52WeekChange?: number;
lastDividendValue?: number;
lastDividendDate?: number;
lastDividendDate?: Date;
ytdReturn?: number;
beta3Year?: number;
totalAssets?: number;
Expand Down Expand Up @@ -278,7 +278,7 @@ export interface EarningsHistoryHistory {
epsEstimate: number | null;
epsDifference: number | null;
surprisePercent: number | null;
quarter: number | null;
quarter: Date | null;
period: string;
}

Expand Down Expand Up @@ -566,9 +566,9 @@ export interface Holder {
transactionDescription: string;
latestTransDate: Date;
positionDirect?: number;
positionDirectDate?: number;
positionDirectDate?: Date;
positionIndirect?: number;
positionIndirectDate?: number;
positionIndirectDate?: Date;
positionSummaryDate?: Date;
}

Expand Down

0 comments on commit 4cf1f62

Please sign in to comment.