Skip to content

Commit f12c1b4

Browse files
committed
Updating workingtime to actual date
1 parent 7e9e8b1 commit f12c1b4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Plugin/os2web/DataLookup/DatafordelerCVR.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,13 @@ public function lookup(string $param): CompanyLookupResult {
169169
private function executeQuery($cvr): ResponseInterface {
170170
$this->httpClient = new Client();
171171

172+
// Setting date to TODAY 00:00:00, so that we are always getting up-to-date
173+
// information.
174+
$virkningstid = (new \DateTimeImmutable('today', new \DateTimeZone('UTC')))
175+
->format('Y-m-d\T00:00:00\Z');
176+
172177
$query = <<<GRAPHQL
173-
{ CVR_Virksomhed(first: 1, virkningstid: "2024-01-01T00:00:00Z", where: { CVRNummer: { eq: {$cvr} } }) {
178+
{ CVR_Virksomhed(first: 1, virkningstid: "{$virkningstid}", where: { CVRNummer: { eq: {$cvr} } }) {
174179
nodes {
175180
CVRNummer
176181
id_CVR_CVREnhed_id_ref(first: 1) {

0 commit comments

Comments
 (0)