Remove timestamp context

This commit is contained in:
Saoud Rizwan 2025-01-15 16:56:17 -08:00
parent 7d1830f90b
commit 52582c44b1
2 changed files with 14 additions and 15 deletions

View file

@ -3,7 +3,6 @@
## [3.1.6]
- Fix bug where filepaths with Chinese characters would not show up in context mention menu (thanks @chi-chat!)
- Add timestamp to prompts to help with certain MCP servers that need the current time (thanks @MrUbens!)
- Update Anthropic model prices (thanks @timoteostewart!)
## [3.1.5]

View file

@ -3149,20 +3149,20 @@ export class Cline {
}
// Add current time information with timezone
const now = new Date()
const formatter = new Intl.DateTimeFormat(undefined, {
year: "numeric",
month: "numeric",
day: "numeric",
hour: "numeric",
minute: "numeric",
second: "numeric",
hour12: true,
})
const timeZone = formatter.resolvedOptions().timeZone
const timeZoneOffset = -now.getTimezoneOffset() / 60 // Convert to hours and invert sign to match conventional notation
const timeZoneOffsetStr = `${timeZoneOffset >= 0 ? "+" : ""}${timeZoneOffset}:00`
details += `\n\n# Current Time\n${formatter.format(now)} (${timeZone}, UTC${timeZoneOffsetStr})`
// const now = new Date()
// const formatter = new Intl.DateTimeFormat(undefined, {
// year: "numeric",
// month: "numeric",
// day: "numeric",
// hour: "numeric",
// minute: "numeric",
// second: "numeric",
// hour12: true,
// })
// const timeZone = formatter.resolvedOptions().timeZone
// const timeZoneOffset = -now.getTimezoneOffset() / 60 // Convert to hours and invert sign to match conventional notation
// const timeZoneOffsetStr = `${timeZoneOffset >= 0 ? "+" : ""}${timeZoneOffset}:00`
// details += `\n\n# Current Time\n${formatter.format(now)} (${timeZone}, UTC${timeZoneOffsetStr})`
if (includeFileDetails) {
details += `\n\n# Current Working Directory (${cwd.toPosix()}) Files\n`