oracle / oci-typescript-sdk

Oracle Cloud Infrastructure SDK for TypeScript and JavaScript
https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/typescriptsdk.htm
Other
71 stars 51 forks source link

OciError: Forecasting invalid date range: Passed UTC date does not have the right precision: hours, minutes, seconds, and second fractions must be 0 #218

Open samuelastech opened 1 year ago

samuelastech commented 1 year ago

I'm passing the following object:

requestSummarizedUsagesDetails: {
  isAggregateByTime: true,
  tenantId: this.#provider.getTenantId(),
  timeUsageStarted: new Date(Date.UTC(2023, 6, 18, 0, 0, 0, 0)),
  timeUsageEnded: new Date(Date.UTC(2023, 7, 18, 0, 0, 0, 0)),
  granularity: usageapi.models.RequestSummarizedUsagesDetails.Granularity.Daily,
  queryType: usageapi.models.RequestSummarizedUsagesDetails.QueryType.Cost,
  forecast: {
    forecastType: usageapi.models.Forecast.ForecastType.Basic,
    timeForecastStarted: new Date(Date.UTC(2023, 7, 18, 0, 0, 0, 0)),
    timeForecastEnded: new Date(Date.UTC(2023, 8, 3, 0, 0, 0, 0))
  },
}

And yet facing the "Passed UTC date does not have the right precision: hours, minutes, seconds, and second fractions must be 0" error.

What have I done wrong?

bhagwatvyas commented 5 months ago

@samuelastech are you still facing this issue with the latest SDK version?