Skip to content

Commit

Permalink
bugfix: Support 15 minute timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
domdomegg committed Aug 8, 2024
1 parent 4cea118 commit 2e1b283
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ To start developing this extension:
2. Install [Node.js](https://nodejs.org/)
3. Run `npm install`
4. Run `npm start` (for the '[local] Scheduling Extension' in the BlueDot Impact software AirTable account)
5. Load the relevant base
6. Make changes to the code and see them reflected in the app!
5. Load the relevant base, open the extensions panel, and click 'Edit extension'
6. Paste in the URL output in the terminal
7. Make changes to the code and see them reflected in the app!

If the changes don't appear to be updating the app, try clicking the extension name then 'Edit extension', then pasting in the server address printed to the console from step 4 (probably `https://localhost:9000`).

Expand Down
4 changes: 2 additions & 2 deletions frontend/algorithm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ const AlgorithmPage = () => {
name: record.getCellValueAsString(table.primaryField.id),
timeAvMins,
timeAvUnits: timeAvMins.map(([s, e]) => [
expectInteger(s / MINUTES_IN_UNIT, 'Expected time availability to be aligned to 30 minute blocks'),
expectInteger(e / MINUTES_IN_UNIT, 'Expected time availability to be aligned to 30 minute blocks')
expectInteger(s / MINUTES_IN_UNIT, 'Expected time availability to be aligned to 15 minute blocks'),
expectInteger(e / MINUTES_IN_UNIT, 'Expected time availability to be aligned to 15 minute blocks')
]),
howManyCohorts:
typeof personType.howManyCohortsPerType === "string"
Expand Down
2 changes: 1 addition & 1 deletion lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const MS_IN_WEEK = 7 * 24 * 60 * 60 * 1000;
export const MINUTES_IN_UNIT = 30;
export const MINUTES_IN_UNIT = 15;
2 changes: 1 addition & 1 deletion lib/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const getCohortCount = (t: number): string => `cohortCount-${t}`;

// See https://www.notion.so/bluedot-impact/Cohort-scheduling-algorithm-5aea0c98fcbe4ddfac3321cd1afd56c3#e9efb553c9b3499e9669f08cda7dd322
export async function solve({ lengthOfMeetingMins, personTypes }: SchedulerInput): Promise<null | Cohort[]> {
// E.g. if we're quantizing to 30 minute units, and our lengthOfMeetingMins = 2, we want 2 unit-long meetings
// E.g. if we're quantizing to 15 minute units, and our lengthOfMeetingMins = 60, we want 4 unit-long meetings
const lengthOfMeetingInUnits = lengthOfMeetingMins / MINUTES_IN_UNIT;

const personTypeNames = new Set();
Expand Down

0 comments on commit 2e1b283

Please sign in to comment.