【发布时间】:2021-09-04 11:32:36
【问题描述】:
有人可以帮助我如何更新我在不同时间段输入的每个项目的日志时间吗?谢谢,^^。我正在使用 Moment.js
<View style={[StyleSheet.absoluteFill, {}]}>
<Animated.View
style={{
justifyContent: 'space-between',
flexDirection: 'row',
alignItems: 'center',
height: 50,
padding: theme.spacing.l,
}}
>
{/* revenues and expenditures will appear */}
<Animated.Text>{item.title}</Animated.Text>
<Text color="silver1">
{/* time */}
{moment().format(' Do , h:mm:ss a')}
</Text>
<Animated.Text
style={{
opacity: hidePrice,
color: item.price > 0 ? '#009BFC' : '#FF4500',
}}
>
{item.price > 0
? `$${item.price}`
: `- $${Math.abs(item.price)}`}
</Animated.Text>
</Animated.View>
</View>
【问题讨论】:
-
当用户添加项目时,你想取当前日期吗?
-
是的,这就是我想要的
标签: javascript react-native momentjs