mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Create function to set date format from recv_time
This commit is contained in:
parent
78fc0bc995
commit
6d16270876
@ -202,6 +202,20 @@ Item
|
||||
var id= ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id)
|
||||
return ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id)
|
||||
}
|
||||
function setTime(){
|
||||
if (!lastMessageData.recv_time){
|
||||
return ""
|
||||
}
|
||||
var timeFormat = "dd.MM.yyyy";
|
||||
var recvDate = new Date(lastMessageData.recv_time*1000)
|
||||
|
||||
// Check if is today
|
||||
if ( new Date (lastMessageData.recv_time*1000).setHours(0,0,0,0) == new Date ().setHours(0,0,0,0)) {
|
||||
timeFormat = "hh:mm"
|
||||
}
|
||||
var timeString = Qt.formatDateTime(recvDate, timeFormat)
|
||||
return timeString
|
||||
}
|
||||
|
||||
function showDetails()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user