@shisyamo4131/air-guard-v2-schemas 2.3.7-dev.26 → 2.3.7-dev.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Employee.js +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shisyamo4131/air-guard-v2-schemas",
3
- "version": "2.3.7-dev.26",
3
+ "version": "2.3.7-dev.27",
4
4
  "description": "Schemas for AirGuard V2",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/Employee.js CHANGED
@@ -285,11 +285,12 @@ export default class Employee extends FireModel {
285
285
 
286
286
  /**
287
287
  * 入社日からの勤続年数を計算します。
288
+ * - 退職日が設定されている場合は、退職日までの勤続年数を計算します。
288
289
  * @returns {{years: number, months: number}|null} 勤続年数(年数と月数)。dateOfHireが設定されていない場合はnull。
289
290
  */
290
291
  get yearsOfService() {
291
292
  if (!this.dateOfHire) return null;
292
- const today = new Date();
293
+ const today = this.dateOfTermination || new Date();
293
294
 
294
295
  let years = today.getUTCFullYear() - this.dateOfHire.getUTCFullYear();
295
296
  let months = today.getUTCMonth() - this.dateOfHire.getUTCMonth();