INNER CODE UNIT · JavaScript

strTime

business-science/free_r_tips · 030_slide_decks_xaringan/libs/datatables-binding/datatables.js:542

              var strTime = function(x) {
                var s = type === 'date' ? 'T00:00:00Z' : '';
                var t = new Date(x + s).getTime();
                // add 10 minutes to date since it does not hurt the date, and
                // it helps avoid the tricky floating point arithmetic problems,
                // e.g. sometimes the date may be a few milliseconds earlier
                // than the midnight due to precision problems in noUiSlider
                return type === 'date' ? t + 3600000 : t;
              };
              if (inArray(type, ['date', 'time'])) {
                v[0] = strTime(v[0]);
                v[1] = strTime(v[1]);
              }
              if (v[0] != slider_min()) v[0] *= scale;
              if (v[1] != slider_max()) v[1] *= scale;
              filter.val(v);
            }
          });

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…