remove timestamp (#583)

Clean up
main
Michael Fix 6 years ago committed by GitHub
parent 737cb979ae
commit 5badd2fbbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -200,14 +200,11 @@ class Editor extends React.Component {
export(format = 'png') {
const link = document.createElement('a')
const timestamp = this.state.timestamp ? `_${formatTimestamp()}` : ''
const prefix = this.state.filename || 'carbon'
return this.getCarbonImage({ format, type: 'blob' }).then(url => {
if (format === 'open') {
link.target = '_blank'
} else {
link.download = `${prefix}${timestamp}.${format}`
if (format !== 'open') {
link.download = `${prefix}.${format}`
}
link.href = url
document.body.appendChild(link)
@ -386,17 +383,6 @@ class Editor extends React.Component {
}
}
function formatTimestamp() {
const timezoneOffset = new Date().getTimezoneOffset() * 60000
const timeString = new Date(Date.now() - timezoneOffset)
.toISOString()
.slice(0, 19)
.replace(/:/g, '-')
.replace('T', '_')
return timeString
}
function isImage(file) {
return file.type.split('/')[0] === 'image'
}

@ -533,6 +533,5 @@ export const DEFAULT_SETTINGS = {
exportSize: '2x',
titleBar: '',
watermark: false,
squaredImage: false,
timestamp: false
squaredImage: false
}

@ -30,7 +30,6 @@ const mappings = [
{ field: 'code:code' },
{ field: 'es:exportSize' },
{ field: 'wm:watermark', type: 'bool' },
{ field: 'ts:timestamp', type: 'bool' },
{ field: 'copy', type: 'bool' },
{ field: 'readonly', type: 'bool' }
]

Loading…
Cancel
Save