dtd
Version:
根据数梦工场视觉规范打造的组件库,感谢react-components和ant design
1 lines • 463 B
JavaScript
import*as React from"react";import{getTodayTime,getTodayTimeStr,isAllowedDate}from"../util/";export default function TodayButton(e){var t=e.prefixCls,a=e.locale,o=e.value,l=e.timePicker,d=e.disabled,i=e.disabledDate,r=e.onToday,n=e.text,m=(!n&&l?a.now:n)||a.today,T=i&&!isAllowedDate(getTodayTime(o),i,null)||d,c=T?t+"-today-btn-disabled":"";return React.createElement("a",{className:t+"-today-btn "+c,role:"button",onClick:T?null:r,title:getTodayTimeStr(o)},m)};