File tree Expand file tree Collapse file tree
pages/parks-by-compass-points Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747 `
4848
4949 function format ( item , r , c ) {
50- const style = `border: 1px solid black; padding: 6px`
50+ let style = `border: 1px solid black; padding: 6px; `
5151 if ( item ) {
52- console . log ( item , rows [ r ] [ quads [ c ] ] )
53- const { day, date, coord} = item
52+ const { day, date, month, coord} = item
53+ if ( diff ( month , r - 1 , c ) ) style += "border-top:2px solid black; "
54+ if ( diff ( month , r , c - 1 ) ) style += "border-left:2px solid black; "
5455 const title = `${ bearing ( coord ) } on ${ date } at ${ r } ,${ c } `
5556 const field = `${ day } ⇒ ${ dist ( coord ) } `
5657 return `<td title="${ title } " style="${ style } ">${ field } `
5758 }
5859 return `<td style="${ style } ">`
5960 }
6061
62+ function diff ( month , r , c ) {
63+ if ( r < 0 || c < 0 ) return false
64+ if ( ! ( quads [ c ] in rows [ r ] ) ) return false
65+ return month != rows [ r ] [ quads [ c ] ] . month
66+ }
67+
6168 function dist ( coord ) {
6269 const [ lat , lon ] = coord . split ( / , / )
6370 const dx = Math . abs ( home . lon - lon ) * 49
You can’t perform that action at this time.
0 commit comments