Browse Source

remove comments

pull/2/head
Muhammad Sulaiman Yusuf 3 years ago
parent
commit
436a2255e5
  1. 33
      src/const/CustomFunc.js

33
src/const/CustomFunc.js

@ -48,7 +48,6 @@ export const hideAttr = [
"m_users_gender", "m_users_gender",
"m_users_name", "m_users_name",
"m_users_phone_number", "m_users_phone_number",
// "jumlah_pekerjaan"
]; ];
export const salesAttrShow = [ export const salesAttrShow = [
@ -114,7 +113,6 @@ export const formatLabel = (label) => {
let output = ""; let output = "";
if (label.includes("_")) { if (label.includes("_")) {
// if sentences
let words = label.split("_"); let words = label.split("_");
for (let i=0; i < words.length; i++) { for (let i=0; i < words.length; i++) {
words[i] = words[i].charAt(0).toUpperCase() + words[i].substr(1); words[i] = words[i].charAt(0).toUpperCase() + words[i].substr(1);
@ -235,32 +233,6 @@ export const getChildrenTree = (data) =>
...item ...item
} }
} }
// else if (item.plannings && item.plannings.length > 0) {
// return {
// "children": getChildrenTree(item.plannings),
// "title": item.nama,
// "key": Math.random(),
// ...item
// }
// }
// OSPRO V2
// else if (item.laporan_plannings && item.laporan_plannings.length > 0) {
// let lp = item.laporan_plannings.map(lp_item => {
// return {
// "nama_subproyek": item.join.m_subproyek_nama,
// "nama_planning": item.nama,
// "nama_user": item.join.m_users_name,
// ...lp_item
// }
// });
// return {
// "key": Math.random(),
// "title": item.nama,
// ...item,
// "laporan_plannings": lp // modify the laporan_plannings
// }
// }
return { return {
"title": item.nama, "title": item.nama,
"key": Math.random(), "key": Math.random(),
@ -275,7 +247,6 @@ export const formatRupiah = (angka, prefix) => {
rupiah = split[0].substr(0, sisa), rupiah = split[0].substr(0, sisa),
ribuan = split[0].substr(sisa).match(/\d{3}/gi); ribuan = split[0].substr(sisa).match(/\d{3}/gi);
var separator = ""; var separator = "";
// tambahkan titik jika yang di input sudah menjadi angka ribuan
if(ribuan){ if(ribuan){
separator = sisa ? '.' : ''; separator = sisa ? '.' : '';
rupiah += separator + ribuan.join('.'); rupiah += separator + ribuan.join('.');
@ -300,7 +271,6 @@ export const formatNumber = (angka) => {
rupiah = split[0].substr(0, sisa), rupiah = split[0].substr(0, sisa),
ribuan = split[0].substr(sisa).match(/\d{3}/gi); ribuan = split[0].substr(sisa).match(/\d{3}/gi);
var separator = ""; var separator = "";
// tambahkan titik jika yang di input sudah menjadi angka ribuan
if(ribuan){ if(ribuan){
separator = sisa ? '.' : ''; separator = sisa ? '.' : '';
rupiah += separator + ribuan.join('.'); rupiah += separator + ribuan.join('.');
@ -322,16 +292,13 @@ sortBy(data, {
prop: "date", prop: "date",
desc: true, desc: true,
parser: function (item) { parser: function (item) {
//ignore case sensitive
return item.toUpperCase(); return item.toUpperCase();
} }
}); });
*/ */
export const sortBy = (function () { export const sortBy = (function () {
var toString = Object.prototype.toString, var toString = Object.prototype.toString,
// default parser function
parse = function (x) { return x; }, parse = function (x) { return x; },
// gets the item to be sorted
getItem = function (x) { getItem = function (x) {
var isObject = x != null && typeof x === "object"; var isObject = x != null && typeof x === "object";
var isProp = isObject && this.prop in x; var isProp = isObject && this.prop in x;

Loading…
Cancel
Save