Categories
Mastering Development

How to build in product expiration in SQL?

I have a table that looks like the following and from it I want to get days remaining of total doses: USER|PURCHASE_DATE|DOSES 1111|2017-07-27|15 2222|2020-07-17|3 3333|2021-02-01|5 If the doses do not have an expiration and each can be used for 90 days then the SQL I use is: SUM(DOSES)*90-DATEDIFF(DAY,MIN(DATE),GETDATE()) USER|DAYS_REMAINING 1111|0 2222|6 3333|385 But what if […]

Categories
Mastering Development

Remove the input textbox’s BOLD frame

Goal: Remove the input textboxs frame’s bold only. It is the same looks without the input textboxs frame’s bold, it should be a single and simple frame. Problem: The input textboxs frame is very bold when you use css code related to background-image, background-size, background-position. If you remove these 3 syntax code, the bold of […]

Categories
Mastering Development

How can I filter duplicates/repeated fields in bigquery?

I have a table without primaryKey. And I am trying to get the events of the earliest date grouped by id. This is what small piece of mytable looks like: |———-|——————|————-| | id | date | events | |———-|——————|————-| | 1 |2020-04-11 3:44:20| call | |———-|——————|————-| | 3 |2020-04-21 7:59:06| appointment | |———-|——————|————-| | 1 […]

Categories
Database Development

Optimizing my query

Here’s my query: DECLARE @monthStartDate date; DECLARE @monthEndDate date; SET @monthStartDate = DATEFROMPARTS(2020,6,1); SET @monthEndDate = EOMONTH(@monthStartDate); SELECT @monthStartDate, MIN([Date]), @monthEndDate, GroupId, TypeId, COUNT(UserID) as ‘CountTotal’, SUM(CASE WHEN [IsA] = 1 THEN 1 ELSE 0 END) as ‘CountA’, SUM(CASE WHEN [IsB] = 1 THEN 1 ELSE 0 END) as ‘CountB’, SUM(CASE WHEN [IsC] = 1 […]

Categories
Development

only specific month is visible in date picker calendar based on 1st field of table

i have a tabular data where 4 fields are there which is already populated dates which is coming from database,1st field is showing month-year like 2-2020 rest 3 date fields are date field having date picker all fields are auto populated while loading the page . Now requirement is suppose 1st row 1st field is […]

Categories
Development

How to extend custom date range selection in bootstrape daterangepicker

I am using bootstrap daterangepicker plugin, I am facing problem by selecting large range like 3-4 years in custom range. currently it allows custom range within one month only. I tried the minDate and maxDate from other plugin which is also not working here. And how can I search all time data by clicking all […]

Categories
Development

Clear react-datepicker on form reset in react-final-form

I’m using react-final-form and react-datepicker. I also have a select for year. Start and end dates should be set to January 1 and December 31 of the default year. When a new year is selected I would like to reset the form, clear selected dates and input values of both datepickers and set them to […]

Categories
Development jQuery

jquery range datepicker on select first date find next disable and disable all future dates

I have a jquery range datepicker with disabled dates from an array and need to disable all future dates after selecting the arrival date, but future dates after the first disabled date after arrival the datepicker code is $(function() { var array = [“2020-05-23″,”2020-05-24″,”2020-05-25″,”2020-05-26″,”2020-05-27″,”2020-05-28″,”2020-05-29″,”2020-05-30″,”2020-09-12″,”2020-09-13″,”2020-09-14″,”2020-09-15″,”2020-09-16″,”2020-09-17″,”2020-09-18″,”2020-09-19″,”2020-05-23″,”2020-05-24″,”2020-05-25″,”2020-05-26″,”2020-05-27″,”2020-05-28″,”2020-05-29″,”2020-05-30″,”2020-06-20″,”2020-06-21″,”2020-06-22″,”2020-06-23″,”2020-06-24″,”2020-06-25″,”2020-06-26″,”2020-06-27″,”2020-06-28″,”2020-06-29″,”2020-06-30″,”2020-07-01″,”2020-07-02″,”2020-07-03″,”2020-07-04″,”2020-09-12″,”2020-09-13″,”2020-09-14″,”2020-09-15″,”2020-09-16″,”2020-09-17″,”2020-09-18″,”2020-09-19”] $(“#arrival”).datepicker({ beforeShowDay: function(date){ var string = jQuery.datepicker.formatDate(‘yy-mm-dd’, date); return [ array.indexOf(string) […]

Categories
Database Development Plugins

undefined index:jumlahcutisemasa. cannot save it to database

Hello everyone and greetings!. need some help on PHP HTML coding here… basically I’m working on a form..unfortunately there’s one form field that cannot be saved to the MySQL database.attached herewith are the pictures. 1st pic: the look of the form…the problem lies on “jumlahcutisemasa” field. 2nd pic:so when i press the “Simpan” or submit […]

Categories
Development jQuery

JQuery UI two datepickers with from and to fields. Disable 5 days from selected date

I am using two date pickers (From and To). Based on a condition I want to disable 5 days in 2nd datepicker(To) after selecting a date in 1st datepicker(from). I tried the following codes… <script type=”text/javascript”> var pkg = “<?php echo $package ?>”; $(function() { if(pkg==”Ordinary”){ var dateFormat = “mm/dd/yy”, from = $(“#date”) .datepicker({ defaultDate: […]