Blame view

天文台pc/tianwentai-ui/node_modules/react-day-picker/src/hooks/useActiveModifiers/useActiveModifiers.tsx 648 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  import { getActiveModifiers, useModifiers } from 'contexts/Modifiers';
  import { ActiveModifiers } from 'types/Modifiers';
  
  /**
   * Return the active modifiers for the specified day.
   *
   * This hook is meant to be used inside internal or custom components.
   *
   * @param day
   * @param displayMonth
   */
  export function useActiveModifiers(
    day: Date,
    /**
     * The month where the date is displayed. If not the same as `date`, the day
     * is an "outside day".
     */
    displayMonth?: Date
  ): ActiveModifiers {
    const modifiers = useModifiers();
    const activeModifiers = getActiveModifiers(day, modifiers, displayMonth);
    return activeModifiers;
  }