File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: { targeting:: Rule , BigNum , ValidatorId } ;
2
- use chrono:: { DateTime , Utc } ;
2
+ use chrono:: {
3
+ serde:: { ts_milliseconds, ts_milliseconds_option} ,
4
+ DateTime , Utc ,
5
+ } ;
3
6
use serde:: { Deserialize , Serialize } ;
4
7
use std:: collections:: HashMap ;
5
8
@@ -32,6 +35,7 @@ pub struct AdSlot {
32
35
/// User address from the session
33
36
pub owner : ValidatorId ,
34
37
/// UTC timestamp in milliseconds, used as nonce for escaping duplicated spec ipfs hashes
38
+ #[ serde( with = "ts_milliseconds" ) ]
35
39
pub created : DateTime < Utc > ,
36
40
/// the name of the unit used in platform UI
37
41
#[ serde( default ) ]
@@ -45,5 +49,6 @@ pub struct AdSlot {
45
49
#[ serde( default ) ]
46
50
pub archived : bool ,
47
51
/// UTC timestamp in milliseconds, changed every time modifiable property is changed
52
+ #[ serde( with = "ts_milliseconds_option" ) ]
48
53
pub modified : Option < DateTime < Utc > > ,
49
54
}
Original file line number Diff line number Diff line change 1
- use chrono:: { DateTime , Utc } ;
1
+ use chrono:: {
2
+ serde:: { ts_milliseconds, ts_milliseconds_option} ,
3
+ DateTime , Utc ,
4
+ } ;
2
5
use serde:: { Deserialize , Serialize } ;
3
6
4
7
use crate :: { ValidatorId , IPFS } ;
@@ -29,6 +32,7 @@ pub struct AdUnit {
29
32
/// user address from the session
30
33
pub owner : ValidatorId ,
31
34
/// number, UTC timestamp in milliseconds, used as nonce for escaping duplicated spec ipfs hashes
35
+ #[ serde( with = "ts_milliseconds" ) ]
32
36
pub created : DateTime < Utc > ,
33
37
/// the name of the unit used in platform UI
34
38
pub title : Option < String > ,
@@ -38,5 +42,6 @@ pub struct AdUnit {
38
42
#[ serde( default ) ]
39
43
pub archived : bool ,
40
44
/// UTC timestamp in milliseconds, changed every time modifiable property is changed
45
+ #[ serde( with = "ts_milliseconds_option" ) ]
41
46
pub modified : Option < DateTime < Utc > > ,
42
47
}
You can’t perform that action at this time.
0 commit comments