Skip to content

Commit

Permalink
variables binding in sample svg certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
tareq89 committed Nov 6, 2024
1 parent d0551b1 commit 082d472
Show file tree
Hide file tree
Showing 8 changed files with 5,377 additions and 958 deletions.
2 changes: 1 addition & 1 deletion src/api/application/application-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const applicationConfig = {
DECLARATION_AUDIT_LOCATIONS: 'DISTRICT',
FEATURES: {
DEATH_REGISTRATION: true,
MARRIAGE_REGISTRATION: false,
MARRIAGE_REGISTRATION: true,
EXTERNAL_VALIDATION_WORKQUEUE: false,
INFORMANT_SIGNATURE: false,
PRINT_DECLARATION: false,
Expand Down
1,439 changes: 1,213 additions & 226 deletions src/api/certificates/source/birth-certificate-certified-copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions src/api/certificates/source/birth-certificate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,168 changes: 986 additions & 182 deletions src/api/certificates/source/death-certificate-certified-copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,069 changes: 926 additions & 143 deletions src/api/certificates/source/death-certificate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,365 changes: 1,204 additions & 161 deletions src/api/certificates/source/marriage-certificate-certified-copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,241 changes: 1,008 additions & 233 deletions src/api/certificates/source/marriage-certificate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions src/form/common/certificate/handlebars/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,30 @@ export function debug(): Handlebars.HelperDelegate {
return value
}
}

export function ordinalFormatDate(): Handlebars.HelperDelegate {
return function (dateString: string) {
const date = new Date(dateString.trim())
const getOrdinalSuffix = (day: number) => {
if (day > 3 && day < 21) return day + 'th'
switch (day % 10) {
case 1:
return day + 'st'
case 2:
return day + 'nd'
case 3:
return day + 'rd'
default:
return day + 'th'
}
}

// Format the date into ex: "11th November 2023"
const day = getOrdinalSuffix(date.getDate())
const month = date.toLocaleString('default', { month: 'long' })
const year = date.getFullYear()

const formattedDate = `${day} ${month} ${year}`
return formattedDate
}
}

0 comments on commit 082d472

Please sign in to comment.