emory-libraries / Pattern-Library

Minimal pattern library based on Emory Libraries' website redesign
0 stars 1 forks source link

Fix order of events in calendar #395

Closed wulman16 closed 4 years ago

wulman16 commented 4 years ago

Events in November and December were displaying out of order in the calendar because (1) moment indexes month values starting at 0 (meaning November is 10 and December is 11), (2) the Pattern Library was saving month values as string values in order to get around a lodash quirk, and (3) months were being compared as strings and not numbers (so "10" comes before "8"). Months are now saved as number values so that they are grouped and compared correctly.