Skip to content

Commit

Permalink
Merge pull request #2332 from CommanderRoot/refactor/rm-deprecated-su…
Browse files Browse the repository at this point in the history
…bstr

Replace deprecated String.prototype.substr()
  • Loading branch information
dartcafe committed Mar 27, 2022
2 parents 92b2b3f + 66656cd commit 8f426e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/js/components/Activity/ActivityItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default {
const subject = this.activity.subject_rich[0]
const parameters = JSON.parse(JSON.stringify(this.activity.subject_rich[1]))
if (parameters.after && typeof parameters.after.id === 'string' && parameters.after.id.startsWith('dt:')) {
const dateTime = parameters.after.id.substr(3)
const dateTime = parameters.after.id.slice(3)
parameters.after.name = moment(dateTime).format('L LTS')
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Base/RadioGroupDiv.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<script>
import { CheckboxRadioSwitch } from '@nextcloud/vue'
const RandId = () => Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10)
const RandId = () => Math.random().toString(36).replace(/[^a-z]+/g, '').slice(2, 12)
export default {
name: 'RadioGroupDiv',
Expand Down
6 changes: 3 additions & 3 deletions src/js/components/Calendar/CalendarInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ export default {
}
const hex = this.event.displayColor.replace(/#/, '')
const r = parseInt(hex.substr(0, 2), 16)
const g = parseInt(hex.substr(2, 2), 16)
const b = parseInt(hex.substr(4, 2), 16)
const r = parseInt(hex.slice(0, 2), 16)
const g = parseInt(hex.slice(2, 4), 16)
const b = parseInt(hex.slice(4, 6), 16)
const l = [
0.299 * r,
Expand Down

0 comments on commit 8f426e5

Please sign in to comment.