Albums: Fix share expiration date in field label #621
Looks like a pure frontend issue: It tried finding a date in "UpdatedAt" while the actual field name is "ModifiedAt".
This commit is contained in:
parent
3c3b19aa8e
commit
03c9e82211
|
@ -107,9 +107,9 @@ export default class Link extends Model {
|
|||
}
|
||||
|
||||
expires() {
|
||||
return DateTime.fromISO(this.UpdatedAt)
|
||||
return DateTime.fromISO(this.ModifiedAt)
|
||||
.plus({ seconds: this.Expires })
|
||||
.toLocaleString(DateTime.DATE_SHORT);
|
||||
.toLocaleString(DateTime.DATE_MED);
|
||||
}
|
||||
|
||||
static getCollectionResource() {
|
||||
|
|
|
@ -79,11 +79,11 @@ describe("model/link", () => {
|
|||
Slug: "friends",
|
||||
Share: "family",
|
||||
Expires: 80000,
|
||||
UpdatedAt: "2012-07-08T14:45:39Z",
|
||||
ModifiedAt: "2012-07-08T14:45:39Z",
|
||||
};
|
||||
const link = new Link(values);
|
||||
const result = link.expires();
|
||||
assert.equal(result, "7/9/2012");
|
||||
assert.equal(result, "Jul 9, 2012");
|
||||
});
|
||||
|
||||
it("should get collection resource", () => {
|
||||
|
|
|
@ -26,7 +26,7 @@ type Link struct {
|
|||
CanComment bool `json:"CanComment" yaml:"CanComment,omitempty"`
|
||||
CanEdit bool `json:"CanEdit" yaml:"CanEdit,omitempty"`
|
||||
CreatedAt time.Time `deepcopier:"skip" json:"CreatedAt" yaml:"CreatedAt"`
|
||||
ModifiedAt time.Time `deepcopier:"skip" yaml:"ModifiedAt"`
|
||||
ModifiedAt time.Time `deepcopier:"skip" json:"ModifiedAt" yaml:"ModifiedAt"`
|
||||
}
|
||||
|
||||
// BeforeCreate creates a random UID if needed before inserting a new row to the database.
|
||||
|
|
Loading…
Reference in a new issue