Skip to content

Commit

Permalink
24524 24701 fix date format in tombstone (#99)
Browse files Browse the repository at this point in the history
* 24524 24701 fix date format in tombstone

* small ui tweak

* update
  • Loading branch information
patrickpeinanw authored Dec 6, 2024
1 parent 4e8fdac commit 5bf6a72
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 9 additions & 4 deletions src/components/bcros/businessDetails/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const legalType = computed(() => {
}
return bootstrapFilingDisplayName.value
})
const limitedRestorationActiveUntilDate = computed(() => {
const date = yyyyMmDdToDate(stateFiling.value?.restoration?.expiry)
return dateToPacificDate(date, true)
})
</script>

<template>
Expand All @@ -21,19 +26,19 @@ const legalType = computed(() => {
{{ name }}
</h2>
<span
class="text-sm text"
class="text-sm"
data-cy="businessTombstone-header-businessType"
>
{{ legalType }}
</span>
&nbsp;
<span
v-if="isInLimitedRestoration"
data-cy="businessTombstone-header-activeUntil"
class="bl-2 border-gray-500"
class="text-sm"
>
<BcrosDivider class="ml-2 mr-1 text-xs text-gray-300" />
{{ $t('label.business.activeUntil') }}
{{ stateFiling?.restoration?.expiry || $t(`label.business.activeUntilUnknown`) }}
{{ limitedRestorationActiveUntilDate || $t(`label.business.activeUntilUnknown`) }}
</span>
</div>
</template>
8 changes: 6 additions & 2 deletions src/components/bcros/businessDetails/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ const getReasonText = computed(() => {
// reason for amalgamation
if (currentBusiness.value.amalgamatedInto) {
const name = t('filing.name.amalgamation')
const date = new Date(currentBusiness.value.amalgamatedInto.amalgamationDate)
const amalgamationDate = apiToDate(currentBusiness.value.amalgamatedInto.amalgamationDate)
if (!amalgamationDate) {
throw new Error('Invalid amalgamation date')
}
const date = dateToPacificDate(amalgamationDate, true)
const identifier = currentBusiness.value.amalgamatedInto.identifier || t('label.general.unknownCompany')
return `${name} ${enDash} ${date} ${enDash} ${identifier}`
}
Expand All @@ -43,7 +47,7 @@ const getReasonText = computed(() => {
reason = t('filing.reason.involuntaryDissolution')
break
case FilingSubTypeE.DISSOLUTION_VOLUNTARY:
reason = isFirm ? t('filing.reason.dissolutionFirm') : t('filing.reason.voluntaryDissolution')
reason = isFirm.value ? t('filing.reason.dissolutionFirm') : t('filing.reason.voluntaryDissolution')
}
const dissolutionDate = yyyyMmDdToDate(stateFiling.value?.dissolution?.dissolutionDate)
Expand Down

0 comments on commit 5bf6a72

Please sign in to comment.