Merge pull request #10076 from crizCraig/local_date

fix: return local date from `getFormattedDate`
This commit is contained in:
Timothy Jaeryang Baek 2025-02-15 20:10:56 -08:00 committed by GitHub
commit b0ad5cd863
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -135,7 +135,6 @@ class SafeWebBaseLoader(WebBaseLoader):
results = await self.fetch_all(urls)
return self._unpack_fetch_results(results, urls, parser=parser)
def lazy_load(self) -> Iterator[Document]:
"""Lazy load text from the url(s) in web_path with error handling."""
for path in self.web_paths:
@ -194,5 +193,5 @@ def get_web_loader(
verify_ssl=verify_ssl,
requests_per_second=requests_per_second,
continue_on_failure=True,
trust_env=trust_env
trust_env=trust_env,
)

View File

@ -1000,7 +1000,10 @@ export const bestMatchingLanguage = (supportedLanguages, preferredLanguages, def
// Get the date in the format YYYY-MM-DD
export const getFormattedDate = () => {
const date = new Date();
return date.toISOString().split('T')[0];
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
};
// Get the time in the format HH:MM:SS