我的传入日期与此字符串完全相同:
myDate= ' 2017-05-05T12:24:06+0000'
Run Code Online (Sandbox Code Playgroud)
我正在使用“react-intl”中的 FormattedDate 来实现我想要的格式
12:24, 5 May 2017
Run Code Online (Sandbox Code Playgroud)
但是有了这个代码:
<FormattedDate
value={myDate}
day="numeric"
month="long"
year="numeric"
hour="numeric"
minute="numeric"/>
Run Code Online (Sandbox Code Playgroud)
我得到这个:
May 5, 2017, 12:24
Run Code Online (Sandbox Code Playgroud)
我一定做错了什么。或者被误解的文档。你能给我建议吗?
一世
是否可以使用伪类为组件设置样式。我有一个复选框,该复选框应显示SVG图像:已选中/未选中以将状态显示为选中/未选中。我可以通过传递父母的道具来做到这一点。但是我被告知只有CSS(样式化组件)才有可能。我的代码的一部分:
const CheckboxInput = styled.input`
&:checked, &:not(:checked) {
display: none;
}`;
const CheckboxLabel = styled.label`
cursor: pointer;
-webkit-user-select: none; /* Chrome/Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+ */
`;
function Checkbox(props) {
return (
<CheckboxLabel htmlFor="id" onChange={() => { props.onchange(); }}>
<CheckboxInput id="id" type="checkbox" checked={props.checked} value="cb" name="cb" />
<Span><SVG glyph={checked} width={17} height={17} /></Span>
<Span><SVG glyph={unchecked} width={17} height={17} /></Span>
{props.children}
</CheckboxLabel>
);
}
Run Code Online (Sandbox Code Playgroud) 我已将removeAttrs 设置为true,我想删除所有填充和颜色:
\n\n{\n loader: 'svgo-loader',\n options: {\n plugins: [\n { removeNonInheritableGroupAttrs: true },\n { collapseGroups: true },\n { removeAttrs: true },\n ],\n },\n },\n
Run Code Online (Sandbox Code Playgroud)\n\n但我不\xc2\xb4t 知道如何指定要删除的属性...
\n