File tree 5 files changed +13
-4
lines changed
5 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export const registerHelpers = () => {
10
10
handlebars . registerHelper ( "addCounts" , helpers . addCounts )
11
11
handlebars . registerHelper ( "ifGreaterThan" , helpers . ifGreaterThan )
12
12
handlebars . registerHelper ( "isDefined" , helpers . isDefined )
13
+ handlebars . registerHelper ( "formatDate" , helpers . formatDate )
13
14
handlebars . registerHelper ( "minusFour" , helpers . minusFour )
14
15
handlebars . registerHelper ( "noUpdatesFormat" , helpers . noUpdatesFormat )
15
16
handlebars . registerHelper ( "toLowerCase" , helpers . toLowerCase )
Original file line number Diff line number Diff line change @@ -22,6 +22,15 @@ export function isDefined(v: unknown) {
22
22
return v !== undefined
23
23
}
24
24
25
+ export function formatDate ( timestamp : Date ) {
26
+ const date = new Date ( timestamp )
27
+ const month = String ( date . getMonth ( ) + 1 ) . padStart ( 2 , "0" )
28
+ const day = String ( date . getDate ( ) ) . padStart ( 2 , "0" )
29
+ const year = date . getFullYear ( )
30
+
31
+ return `${ month } /${ day } /${ year } `
32
+ }
33
+
25
34
export function minusFour ( value : number ) {
26
35
const result = value - 4
27
36
return result
Original file line number Diff line number Diff line change 15
15
</h2 >
16
16
<p class =" subheadline blue center" style =" font-weight: 600; font-size: 12px; line-height: 125%;
17
17
color: #1a3185; display: block; margin: auto; width: 30%" >
18
- {{ startDate }} - {{ endDate }}
18
+ {{ formatDate startDate }} - {{ formatDate endDate }}
19
19
</p >
20
20
</div >
21
21
<img src =" https://mapletestimony.org/email/images_no-svgs/Mail Report.png" alt =" Report" style =" display: block; margin: auto; width: 32%" />
22
- {{!-- On prod, replace with: --}}
23
- {{!-- <img src="https://mapletestimony.org/email/images_no-svgs/Mail Report.png" alt="Report" style="display: block; margin: auto; width: 32%;" /> --}}
24
22
</header >
Original file line number Diff line number Diff line change 1
- <div class = " noUpdatesIcon " >
1
+ <div style = " padding-top: 12px; padding-bottom: 20px; display: block; margin: auto; width: 65% " >
2
2
<img src =" https://mapletestimony.org/email/images_no-svgs/empty-mail.png" alt =" Empty Mail" />
3
3
</div >
4
4
<h5 style =" font-weight: 600; font-size: 25px; line-height: 125%; margin-bottom: 0px;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ const EMAIL_TEMPLATE_PATH = "./functions/src/email/digestEmail.handlebars"
22
22
handlebars . registerHelper ( "addCounts" , helpers . addCounts )
23
23
handlebars . registerHelper ( "ifGreaterThan" , helpers . ifGreaterThan )
24
24
handlebars . registerHelper ( "isDefined" , helpers . isDefined )
25
+ handlebars . registerHelper ( "formatDate" , helpers . formatDate )
25
26
handlebars . registerHelper ( "minusFour" , helpers . minusFour )
26
27
handlebars . registerHelper ( "noUpdatesFormat" , helpers . noUpdatesFormat )
27
28
handlebars . registerHelper ( "toLowerCase" , helpers . toLowerCase )
You can’t perform that action at this time.
0 commit comments