Skip to content

Instantly share code, notes, and snippets.

@yurenju
Created July 13, 2017 05:13
Show Gist options
  • Save yurenju/48dfbd03516e99fb0d7da480cefb5e09 to your computer and use it in GitHub Desktop.
Save yurenju/48dfbd03516e99fb0d7da480cefb5e09 to your computer and use it in GitHub Desktop.
// 一個月薪 25000 男性,今天剛上班的勞工,在平常日從八點工作十一個小時
// 他的加班費應該為 451 元
const labor = new Labor()
labor.setAge(20)
.setGender(Gender.MALE)
.onBoard(new Date())
.setMonthlySalary(25000)
const worktime = new WorkTime(Duration.DAY, labor)
const start = new Date(2017, 6, 5, 8)
worktime.add(start, 11)
const result = worktime.overtimePay()
expect(result.value.overtimePay).eq(451)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment