This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dateParseHelper = sessions => { | |
let options = { | |
day: "numeric", | |
month: "short", | |
year: "numeric", | |
hour: "2-digit", | |
minute: "2-digit", | |
hourCycle: "h24" | |
}; | |
const convertedSessions = sessions.map(session => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const logger = state => { | |
return next => { | |
return action => { | |
console.log("Previous state:"); | |
console.log(state.getState()); | |
console.log("Dispatching action:"); | |
console.log(action); | |
const result = next(action); | |
console.log("Next state:"); | |
console.log(state.getState()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
selected_session = Session.first | |
sessions = Session.all | |
sessions.each do | session | | |
if selected_session.id != session.id | |
puts session if (session.start_date .. session.end_date).cover?(selected_session.start_date) && (session.start_date .. session.end_date).cover?(selected_session.end_date) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input[name="dob"]:before { | |
content: "Date of Birth"; | |
color: #aaa; | |
margin-right: 0.5em; | |
} | |
input[name="dob"]:focus:before, | |
input[name="dob"]:valid:before { | |
content: ""; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { mount } from "enzyme"; | |
import FlashMessage from "./FlashMessage"; | |
import { act } from "react-dom/test-utils"; | |
describe("FlashMessage", () => { | |
let container, messageMock; | |
beforeEach(() => { | |
jest.useFakeTimers(); | |
messageMock = "Test message"; |