The new suffix is still a time that follows the ISO standard as it can
be converted into any other time zone through the time zone prefix of
itself.
Fixes: https://tracker.ceph.com/issues/23858
Signed-off-by: Stephan Müller <smueller@suse.com>
it('should display suggested snapshot name', () => {
component.openCreateSnapshotModal();
expect(component.modalRef.content.snapName).toMatch(
- RegExp(`^${component.rbdName}-\\d+T\\d+Z\$`)
+ RegExp(`^${component.rbdName}_[\\d-]+T[\\d.:]+\\+[\\d:]+\$`)
);
});
});
} else {
// Auto-create a name for the snapshot: <image_name>_<timestamp_ISO_8601>
// https://en.wikipedia.org/wiki/ISO_8601
- snapName = `${this.rbdName}-${moment()
- .utc()
- .format('YYYYMMDD[T]HHmmss[Z]')}`;
+ snapName = `${this.rbdName}_${moment().toISOString(true)}`;
}
this.modalRef.content.setSnapName(snapName);
this.modalRef.content.onSubmit.subscribe((snapshotName: string) => {