Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 22ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
a

annual-leave

Recently created Least recently created Recently updated Least recently updated

timmy / 特休計算器 (Annual Leave Calculator)

Last active 6 hours ago Taiwan annual-leave hr-tool labor-law python

此 Python 類別可根據《勞動基準法》第 38 條規定,計算勞工應享有的特休天數,適用於 HR、人資系統或勞工自行查詢特休日數,確保符合法規標準。

0 0 0 1
1 class AnnualLeaveCalculator:
2 def __init__(self, employment_date, current_date):
3 """
4 初始化特休計算器
5 :param employment_date: 入職日期,格式為 'YYYY-MM-DD'
6 :param current_date: 目前日期,格式為 'YYYY-MM-DD'
7 """
8 self.employment_date = employment_date
9 self.current_date = current_date