Skip to content

Footer in generated pdf should use dd.MM.yyyy HH:mm:ss #1334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 4, 2025
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/Altinn.App.Core/Internal/Pdf/PdfService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
else if (displayFooter)
{
footerContent = GetFooterContent(instance, textResource);
_logger.LogInformation($"Footer content: {footerContent}");
}

Stream pdfContent = await _pdfGeneratorClient.GeneratePdf(uri, footerContent, ct);
Expand Down Expand Up @@ -284,7 +285,20 @@
DateTimeOffset now = TimeZoneInfo.ConvertTime(DateTimeOffset.UtcNow, timeZone);

string title = GetTitleText(textResource) ?? "Altinn";
string dateGenerated = now.ToString("G", new CultureInfo("nb-NO"));

_logger.LogInformation("--------------------------------------------------------");
_logger.LogInformation($"Current culture: {CultureInfo.CurrentCulture.Name}");
_logger.LogInformation($"Current UI culture: {CultureInfo.CurrentUICulture.Name}");
_logger.LogInformation(
$"DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: {Environment.GetEnvironmentVariable("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT")}"
);

_logger.LogInformation($"Successfully created nb-NO culture");

// string dateGenerated = now.ToString("G", nbCulture);
string dateGenerated = now.ToString("dd.MM.yyyy HH:mm:ss", new CultureInfo("nb-NO"));
_logger.LogInformation($"Generated date with nb-NO culture: {dateGenerated}");

string altinnReferenceId = instance.Id.Split("/")[1].Split("-")[4];

string footerTemplate =
Expand Down
Loading