A calm place to write long-form, and publish it to the open social web. skypress.blog/
0

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'fix-greeting-time-of-day' into trunk

+20 -1
+19
src/lib/landing/time-of-day.test.ts
··· 33 33 expect( p.lede.length ).toBeGreaterThan( 0 ); 34 34 } 35 35 } ); 36 + 37 + // The greeting is rendered next to the live clock ("<greeting> · 10:23"), so a 38 + // calendar word in it must agree with the wall clock — no "Good afternoon" before noon. 39 + it( 'never greets with a time-of-day word that contradicts the hour', () => { 40 + for ( let hour = 0; hour < 24; hour++ ) { 41 + const { greeting } = PHASES[ phaseForHour( hour ) ]; 42 + const at = `"${ greeting }" shown at ${ hour }:00`; 43 + if ( /morning/i.test( greeting ) ) { 44 + expect( hour, at ).toBeLessThan( 12 ); 45 + } 46 + if ( /afternoon/i.test( greeting ) ) { 47 + expect( hour, at ).toBeGreaterThanOrEqual( 12 ); 48 + expect( hour, at ).toBeLessThan( 18 ); 49 + } 50 + if ( /evening/i.test( greeting ) ) { 51 + expect( hour, at ).toBeGreaterThanOrEqual( 17 ); 52 + } 53 + } 54 + } ); 36 55 } );
+1 -1
src/lib/landing/time-of-day.ts
··· 30 30 lede: 'A calm place to write long-form, and publish it to the open social web.', 31 31 }, 32 32 midday: { 33 - greeting: 'Good afternoon', 33 + greeting: 'Sun’s up', 34 34 headlineHtml: 'Write something <em>worth keeping.</em>', 35 35 lede: 'A calm place to write long-form, and publish it to the open social web.', 36 36 },