PROBLEM WITH DATE PICKER:

Hi, I want to use the date picker as it... and set to the current value of default.and use another text box to display the selected value... to datepicker.can someone give me the entire code? If I want to write the value selected, run time using a picture as a textbox, what should I do?... Please help me... its urgent...

OK, but I used the images for what little arrows... to prevmonth, nextmonth, prevyear and next.

Here's the code...

import net.rim.device.api.ui.container.PopupScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Field;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.DrawStyle;
import net.rim.device.api.system.Characters;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.util.DateTimeUtilities;
import net.rim.device.api.i18n.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import com.LMS.CustomManagers.TableLayoutManager;
/**
 *
 */
public class CalendarPopup extends PopupScreen implements FieldChangeListener {

    private boolean isClosed = false;
    private static SimpleDateFormat sdfWeekDay = new SimpleDateFormat("Ei");
    private static SimpleDateFormat sdfMonth = new SimpleDateFormat("MMM yyyy");
    private Calendar _cl = Calendar.getInstance();

    private Bitmap PrevYearFocus = Bitmap.getBitmapResource("cal_previous_year.png");
    private Bitmap PrevMonthFocus = Bitmap.getBitmapResource("cal_previous_month.png");
    private Bitmap NextMonthFocus = Bitmap.getBitmapResource("cal_next_month.png");
    private Bitmap NextYearFocus = Bitmap.getBitmapResource("cal_next_year.png");
    private Bitmap PrevYear = Bitmap.getBitmapResource("cal_previous_year_focus.png");
    private Bitmap PrevMonth = Bitmap.getBitmapResource("cal_previous_month_focus.png");
    private Bitmap NextMonth = Bitmap.getBitmapResource("cal_next_month_focus.png");
    private Bitmap NextYear = Bitmap.getBitmapResource("cal_next_year_focus.png");

    private static int [] tableStyles = new int [] {
        TableLayoutManager.FIXED_WIDTH,
        TableLayoutManager.FIXED_WIDTH,
        TableLayoutManager.FIXED_WIDTH,
        TableLayoutManager.FIXED_WIDTH,
        TableLayoutManager.FIXED_WIDTH,
        TableLayoutManager.FIXED_WIDTH,
        TableLayoutManager.FIXED_WIDTH
    };
    private int [] tableSizes = new int [7];
    private TableLayoutManager _monthManager; // This is where we display the Dates

    private static String FIELD_SIZE_STRING = " 30 ";
    private static String SINGLE_BLANK = " ";

    private int _currentFocusDay;
    private int _currentMonth; // This is the month as usually defined. // In Calendar, January is month 0.
    private int _currentYear;
    private String _currentMonthString = "MMM yyyy";
    private Field _initialFocusField = null;
    private int _selectedDay = -1; // None selected

    private Font _normalFont;
    private Font _boldFont;

    private ClickbleImage PrevYearBut, PrevMonthBut, NextMonthBut, NextYearBut;
    private BorderedLabel MonthDisplay,Today;

    public CalendarPopup(Date selectedDate) {
        super(new VerticalFieldManager(){
                public void sublayout(int width, int height) {
                    super.sublayout(Display.getWidth(),height);
                }
            });
        _cl.setTime(selectedDate);
        createScreen(_cl.get(Calendar.DAY_OF_MONTH), _cl.get(Calendar.MONTH) + 1, _cl.get(Calendar.YEAR));
    }

    public boolean isClosed(){
        return isClosed;
    }
    private void displayMonth() {
        _monthManager.deleteAll(); // Delete the stuff currently there

        // Determine start of the Month
        _cl.set(Calendar.DAY_OF_MONTH, 1);
        _cl.set(Calendar.MONTH, _currentMonth - 1);
        _cl.set(Calendar.YEAR, _currentYear);
        _cl.set(Calendar.HOUR_OF_DAY, 12);
        _cl.set(Calendar.MINUTE, 0);
        _cl.set(Calendar.SECOND, 0);
        _cl.set(Calendar.MILLISECOND, 1);
        long startOfMonth = _cl.getTime().getTime();  

        // set Month in 'header'
        _currentMonthString = sdfMonth.formatLocal(_cl.getTime().getTime());

        // Figure out where the month display needs to start
        int workDay = _cl.get(Calendar.DAY_OF_WEEK);
        int startAt = 0;
        switch (workDay) {
            case(Calendar.MONDAY): {
                startAt = 0;
                break;
            }
            case(Calendar.TUESDAY): {
                startAt = -1;
                break;
            }
            case(Calendar.WEDNESDAY): {
                startAt = -2;
                break;
            }
            case(Calendar.THURSDAY): {
                startAt = -3;
                break;
            }
            case(Calendar.FRIDAY): {
                startAt = -4;
                break;
            }
            case(Calendar.SATURDAY): {
                startAt = -5;
                break;
            }
            case(Calendar.SUNDAY): {
                startAt = -6;
                break;
            }
        }
        Date workDate = _cl.getTime();
        long workDateTime = workDate.getTime() + ((long)startAt) * ((long)DateTimeUtilities.ONEDAY);

        //long dayTime = workDateTime;
        for ( int i = 0; i < 42; i++ ) { // Need at most 6 rows
            workDate.setTime(workDateTime);
            _cl.setTime(workDate);
            workDateTime = workDateTime + DateTimeUtilities.ONEDAY;
            BorderedLabel blf = null;
            //int actualDate = _cl.get(Calendar.DAY_OF_MONTH);
            int actualDate = _cl.get(Calendar.DAY_OF_MONTH);
            String tempDateString = Integer.toString(actualDate);
            int textColor = Color.BLACK;
            if ( _cl.get(Calendar.MONTH) == _currentMonth - 1 ) {
                if ( _currentFocusDay == actualDate ) {
                    _initialFocusField = blf;
                    textColor = Color.RED;
                }
                blf = new BorderedLabel(tempDateString, LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER | LabelField.FOCUSABLE,textColor);
            } else
            if ( (i % 7 == 0) && (startOfMonth < _cl.getTime().getTime()) ) {
                // We have finished the month
                break;
            } else {
                blf = new BorderedLabel(tempDateString, LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER,Color.LIGHTGREY);
            }
            blf.setChangeListener(this);
            _monthManager.add(blf);
        }
        if ( this.isDisplayed() && _initialFocusField != null ) {
            _initialFocusField.setFocus();
            _initialFocusField = null;
        }
        MonthDisplay.SetText(_currentMonthString);
    }

    private void createScreen(int focusDay, int startMonth, int startYear) {
        // Initial values for Screen
        _currentFocusDay = focusDay;
        _currentMonth = startMonth;
        _currentYear = startYear;
        final VerticalFieldManager topManager = new VerticalFieldManager(FIELD_HCENTER){
                public void paint(Graphics g){
                    g.setColor(0x333333);
                    g.fillRect(0,0,getWidth(),getHeight());
                    super.paint(g);
                }
            };

        int columnSize = this.getFont().getAdvance(FIELD_SIZE_STRING);
        for ( int i = 0; i < tableSizes.length; i++ ) {
            tableSizes[i] = columnSize;
        }
        _monthManager = new TableLayoutManager(tableStyles, tableSizes, 0, TableLayoutManager.FIELD_HCENTER){
                public void paint(Graphics g){
                    g.setColor(Color.WHITE);
                    g.fillRect(0,0,getWidth(),getHeight());
                    super.paint(g);
                }
            };

        VerticalFieldManager bottomManager = new VerticalFieldManager(FIELD_HCENTER){
                public void paint(Graphics g){
                    g.setColor(0x333333);
                    g.fillRect(0,0,getWidth(),getHeight());
                    super.paint(g);
                }
                protected void sublayout(int width, int height) {
                    super.sublayout(width, height);
                    setExtent(topManager.getWidth(), 30);
                }
            };
        PrevYearBut = new ClickbleImage(PrevYearFocus,PrevYear,FIELD_HCENTER | FOCUSABLE);
        PrevYearBut.setChangeListener(this);
        PrevMonthBut = new ClickbleImage(PrevMonthFocus,PrevMonth,FIELD_HCENTER | FOCUSABLE);
        PrevMonthBut.setChangeListener(this);
        MonthDisplay = new BorderedLabel(_currentMonthString,NON_FOCUSABLE,Color.WHITE);
        MonthDisplay.setChangeListener(this);
        NextMonthBut = new ClickbleImage(NextMonthFocus,NextMonth,FIELD_HCENTER | FOCUSABLE);
        NextMonthBut.setChangeListener(this);
        NextYearBut = new ClickbleImage(NextYearFocus,NextYear,FIELD_HCENTER | FOCUSABLE);
        NextYearBut.setChangeListener(this);
        HorizontalFieldManager hfm  = new HorizontalFieldManager(FIELD_HCENTER);
        hfm.add(PrevYearBut);hfm.add(new VerticalSpacer(5,3));
        hfm.add(PrevMonthBut);hfm.add(new VerticalSpacer(5,3));
        hfm.add(MonthDisplay);hfm.add(new VerticalSpacer(5,3));
        hfm.add(NextMonthBut);hfm.add(new VerticalSpacer(5,3));
        hfm.add(NextYearBut);
        topManager.add(hfm);

        TableLayoutManager _daysManager = new TableLayoutManager(tableStyles, tableSizes, 0,TableLayoutManager.FIELD_HCENTER);
        String [] days = {"Mo","Tu","We","Th","Fr","Sa","Su"};
        for(int i = 0 ; i < days.length;i++){
            _daysManager.add(new BorderedLabel(days[i],NON_FOCUSABLE | FIELD_HCENTER,Color.WHITE));
        }
        topManager.add(_daysManager);
        displayMonth();

        HorizontalFieldManager hfm1  = new HorizontalFieldManager();
        Today = new BorderedLabel("Today",FOCUSABLE | FIELD_VCENTER,Color.WHITE);
        Today.setChangeListener(this);
        int space = Display.getWidth() >= 480 ? 130 : 90;
        hfm1.add(new VerticalSpacer(30,space));hfm1.add(Today);hfm1.add(new VerticalSpacer(30,space));
        bottomManager.add(hfm1);

        this.add(topManager);
        this.add(_monthManager);
        this.add(bottomManager);
    }
    protected void onDisplay() {
        if ( _initialFocusField != null ) {
            _initialFocusField.setFocus();
            _initialFocusField = null;
        }
        super.onDisplay();
    }
    public void fieldChanged(Field field, int context){
        _currentFocusDay = -1; // Leave focus on 'button'
        _initialFocusField = field;
        int monthIncrement = 33;
        if(field instanceof ClickbleImage){
            if(field == PrevYearBut){
                _currentYear = _cl.get(Calendar.YEAR)-1;
                displayMonth();
            }else if(field == PrevMonthBut){
                monthIncrement = -3;
                processMonth(monthIncrement);
            }else if(field == NextMonthBut){
                processMonth(monthIncrement);
            }else if(field == NextYearBut){
                _currentYear = _cl.get(Calendar.YEAR)+1;
                displayMonth();
            }
        }else if(field instanceof BorderedLabel){
            if(field == MonthDisplay){
            }else if(field == Today){
                _cl.setTime(new Date());
                _currentFocusDay = _cl.get(Calendar.DAY_OF_MONTH);
                _currentMonth = _cl.get(Calendar.MONTH) + 1;
                _currentYear = _cl.get(Calendar.YEAR);
                displayMonth();
            }else {
                LabelField lab = (LabelField) field;
                _selectedDay = Integer.parseInt(lab.getText());
                close();
            }
        }
    }
    private void processMonth(int monthIncrement){
        _cl.set(Calendar.DAY_OF_MONTH, 1);
        _cl.set(Calendar.MONTH, _currentMonth-1);
        _cl.set(Calendar.YEAR, _currentYear);
        Date workDate = _cl.getTime();
        workDate.setTime(workDate.getTime() + (((long)monthIncrement) * ((long)DateTimeUtilities.ONEDAY)));
        _cl.setTime(workDate);
        _currentMonth = _cl.get(Calendar.MONTH) + 1;
        _currentYear = _cl.get(Calendar.YEAR);
        displayMonth();
    }
    public void close() {
        UiApplication.getUiApplication().popScreen(this);
    }
    public Date getSelectedDate() {
        if ( _selectedDay == -1 ) {
            return null;
        }
        Calendar cl = Calendar.getInstance();
        cl.set(Calendar.YEAR, _currentYear);
        cl.set(Calendar.MONTH, _currentMonth - 1);
        cl.set(Calendar.DAY_OF_MONTH, _selectedDay);
        cl.set(Calendar.HOUR_OF_DAY, 0);
        cl.set(Calendar.MINUTE, 0);
        cl.set(Calendar.SECOND, 0);
        cl.set(Calendar.MILLISECOND, 1);
        return cl.getTime();
    }
    public boolean keyChar(char key, int status, int time) {
        boolean retval = false;
        switch (key) {
            case Characters.ENTER: {
                // We have selected something
                break;
            }
            case Characters.ESCAPE: {
                close();
                isClosed = true;
                retval = true;
                break;
            }
            default:
                break;
       }
       return retval;
    }
} 

class ClickbleImage extends Field {
    private Bitmap bitmap1,bitmap2,img;
    private boolean isFocus = false;
    public ClickbleImage(Bitmap bitmap1,Bitmap bitmap2,long style) {
        super(style);
        this.bitmap1 = bitmap1;
        this.bitmap2 = bitmap2;
        img = bitmap1;
    }
    protected boolean navigationClick(int status, int time) {
        fieldChangeNotify(0);
        return true;
    }
    protected void onUnfocus() {
        isFocus = false;
        super.onUnfocus();
        img =  bitmap1;
        invalidate();
    }
    protected void onFocus(int direction) {
        super.onFocus(direction);
        isFocus = true;
        img =  bitmap2;
        invalidate();
    }
    public void paint(Graphics g){
        g.drawBitmap((this.getWidth()-img.getWidth())/2,(this.getHeight()-img.getHeight())/2,img.getWidth(),img.getHeight(),img,0,0);
    }
    protected void layout(int w, int h){
        setExtent(20,20);
    }
    protected void drawFocus(Graphics graphics, boolean on) {
    }
} 

class BorderedLabel extends LabelField {
    int width,height,color;
    private String text;
    private Font font;
    public BorderedLabel(String text, long style,int TextColor) {
        super(text, style);
        SetFont(Font.PLAIN,18);
        this.color = TextColor;
        this.text = text;
    }
    public void SetText(String text){
        this.text = text;
        invalidate();
    }
    public void paint(Graphics g) {
        width = this.getWidth();
        height = this.getHeight();
        if(isFocus()){
            g.setColor(Color.YELLOW);
            g.fillRect(0,0,width,height);
            g.setColor(Color.BLACK);
        }else {
            g.setColor(color);
        }
        g.drawText(text, (getWidth() - font.getAdvance(text))/2, (getHeight() - font.getHeight())/2);
    } 

    protected void onFocus(int direction) {
        super.onFocus(direction);
        invalidate();
    } 

    protected void onUnfocus() {
        super.onUnfocus();
        invalidate();
    } 

    private void SetFont(int font_style, int font_size) {
        font = Font.getDefault().derive(font_style,font_size);
        this.setFont(font);
    }
    protected boolean navigationClick(int status, int time) {
        fieldChangeNotify(0);
        return true;
    }
}

class VerticalSpacer extends Field {
    // Only for VerticalFieldManagers
    private int _height;
    private int _width;
    public VerticalSpacer(int height, int width) {
        super(Field.NON_FOCUSABLE);
        _height = height;
        _width = width;
    }
    public void layout(int width, int hieght) {
        setExtent(_width, _height);
    }
    public void paint(Graphics g) {
    }
}

I think you have the right to TableLayoutManager? If this isn't the case, then search the forum and you will get. Which I used here.

call this class-

SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");

You can use any format here (above)

CalendarPopup dd = new CalendarPopup (date)

UiApplication.getUiApplication () .pushModalScreen (dd);
{if (!) CDI IsClosed())}
Date selectedDate = dd.getSelectedDate ();
String DateStrValue = formatter.format (selectedDate) m:System.NET.SocketAddress.ToString ();
textbox.setText ((DateStrValue) formatter.format m:System.NET.SocketAddress.ToString ());
}

TextBox is the lable field or anything like that

Tags: BlackBerry Developers

Similar Questions

  • Problem with the Picker

    Hello
    I'm new to APEX and working on version 3.2

    I have a page that appears, based on a combination of select list and selector of dates.

    I used a component 'select list with Submit"so that when a value is changed, the page is sent to new and region is created based on the value in the select list and date picker.
    But how I can get the same functionality, when the date is changed by using the date picker, assuming that there is value in the select list?

    Essentially how to call the function send when the Date in the Date Picker control is changed?


    concerning

    Hello

    Users!

    I don't know Oracle Reports, so could not tell if it is feasible. Theoretically, a Web page can be used in an IFRAME tag on a page - so if there is a way to indicate the Oracle reports on what data are needed for the report and authentication is not a problem, then I guess it could be possible.

    Andy

  • Structure of the event: problem with data transfer

    Hello everyone,

    for three days I'm troubleshooting an issue in LabView with the event structures. I really hope someone can help here, because I can't find anything on the entire WEB.

    I had six groups of equal to a VI entry, each containing five checks enum (among others) where the user can specify some configuration of measurement data. I want the program to do is: to recognize if a any of these enum values has been changed and if yes, then submit the values containing the cluster in a subvi then calculates the wiring and affect the material of the ports. In addition, i need to submit the number of the enum element that was changed, so the program is able to clear the user input in the case of a breach (e.g. If the user sets two entries of enum control 1 meter and 2 Group 1 and then tries to set a third counter of entry to port 3, the program displays a message and deletes third entry as the number of entries of counter is limited to 2 per cluster).

    To resolve this problem, I used a structure of the event with 6 x 5 cases (change of enum value 1 Group 1 Group 1 enum value 2 change... and so on until the change in the value enum 5 Group 6).

    The problem is that if the user changes a value, the event structure reacts and performs the proper case; However VALUES of the cluster, the user changed are not subject to the SECOND time that an event occurs. It is a kind of a situation, "n-1". For example, if all five controls Enum of Group 1 are 'disabled' first and the user sets enum 3 of 'Meter entry', the structure of the event runs but submits the values previous to the Subvi (all enums 'Disabled'). When the user makes the second change, say that enum SWITCH1 to "Analog Input", the structure of the event is running again and passes the values of the FIRST user to the Subvi editing, then the Subvi gets data "enum 3 meter inlet and all other disabled enumerations.

    In easier words: if I have new values on my cluster "Kanal 1" (left side of the screenshot) and run the structure of the event, on the right side to "Kanal 1" indicator, I get the previous values (n-1).

    The structure of my event is in a while loop. If I create a timeout every 10 ms, and a loop of 250 ms the waiting time, I got the 80% chance that the recent changes are transferred to the Subvi correctly, in other cases I have a delay of the 1 step as described above. It seems to be directly based on the time that I specify the while to wait - but I can't explain it and I cannot accept a less than 100% chance to transfer the correct data, nor can I accept delays of a few seconds for each loop run. If I indicate timeout (infinite) get delayed 1-1 step values in all cases.

    When I specify cases of event to react on "all items value change" of the structure of the event behaves properly - but then I can't handle indicate which element has changed, as the CtlRef of output in case of a structure does not specify "enum 1, enum 2..." but only "Group 1".

    Does anyone have a solution to this? It is certainly a problem with the structure of the event, but I can't understand what to change.

    Thank you much in advance,

    Mr. Boiger

    This is because the terminal is read until the structure of the event runs.   Terminal is read, the event structure is waiting for an event.  The change in value.  Business events are running, but the value is the old value.

    Put the terminal inside the event.

    Or, you can display the connector called "New value" on the side left (stretching down from the border of the node 'CtrRef').  Use a wire one to come.

  • Problem with date and time

    HP Elite m9498d, Windows Vista 32-bit. Battery change, but the time and date again goes back to January 2002?

    Then, it might be a problem with the BIOS itself. Try to update the BIOS which for sure should solve the problem.

  • Problems with date calculation

    I have a java (and much more far vb) background and it seems that I'm really dependent functions for date calculations.  I'm trying to do a few things, but have not been able to accomplish them.

    I do not have

    Calendar.add()
    

    I briefly contemplated an add function by converting into long then do the calculation and returns a new calendar object, but the problems with this approach comes flourishes as soon as I started.  Just trying to find out if a date was yesterday was me banging my head against the wall.

    Any help please?

    I wrote this, but I don't know if there is a simpler method, go to this issue the wrong way, etc.

    public static boolean isYesterday(Calendar c) {
        Calendar today = Calendar.getInstance();
        int newDay = today.get(Calendar.DAY_OF_MONTH);
        if (newDay == 1) { //get last day of previous month
            int newMonth = today.get(Calendar.MONTH);
            int newYear = today.get(Calendar.YEAR);
            /* If jan 1, get dec of last year */
            if (newMonth == 0) { //Java Calendar.MONTH is zero-based
                newMonth = 11;
                newYear -= 1;
            today.set(Calendar.YEAR, newYear);
            }
            today.set(Calendar.MONTH, newMonth);
            newDay = DateTimeUtilities.getNumberOfDaysInMonth(newMonth, newYear);
        } else {
            newDay -= 1;
        }
        today.set(Calendar.DAY_OF_MONTH, newDay);
        return DateTimeUtilities.isSameDate(today.getTime().getTime(), c.getTime().getTime());
    }
    

    'convert to tz to the device.

    I recommend that stick you with using UTC for everything.  If you want to display to the user, then a DateField will convert the hour UTC to local time.  SImpleDateFormat.formatLocal will also print you long time UTC to local time.  So I recommend that you do not have to convert once at the local level.

    Remember that System.currentTimeMillis () is time not UTC/GMT.

    Of course, that's a good advice or not depends on your app.

    I'm not aware of any third-party code that helps, I reinvented wheels square to all my treatment to date.  But I never really looked at.

    About your code, assuming that c calendar uses the local time zone, so I think that the code works.

  • Help with Date Picker months classic display in 4.2.5.00.08

    Version: 4.2.5.00.08

    Topic: business 3

    Hello

    I have two selectors classical fields of dates that represent a Date "from" and "to this day".

    When you click on the calendar icon and change the month in the select list on the "Date from" and selecting a date, and then by opening the 'to Date' by clicking on the icon of the month calendar is displayed corresponds to the current month (sysdate) in the Select list.

    Demand for the user must have the month in the match of the calendar 'To Date' the month selected on the calendar "Date from" when you click on the calendar icon on "Date to the.

    Since this announcement, the current month is September. If the month is changed in October and a date is selected in the 'Date' then I click on the 'To Date' calendar icon the month displayed in the list select should be October not September.

    How can this be achieved?

    Thank you

    Joe

    Joe R wrote:

    Version: 4.2.5.00.08

    Topic: business 3

    I have two selectors classical fields of dates that represent a Date "from" and "to this day".

    The two dates selectors 'Business' and classic theme 3 are well beyond their expiration date. A modernization program for this app would be a very good idea...

    When you click on the calendar icon and change the month in the select list on the "Date from" and selecting a date, and then by opening the 'to Date' by clicking on the icon of the month calendar is displayed corresponds to the current month (sysdate) in the Select list.

    Demand for the user must have the month in the match of the calendar 'To Date' the month selected on the calendar "Date from" when you click on the calendar icon on "Date to the.

    Since this announcement, the current month is September. If the month is changed in October and a date is selected in the 'Date' then I click on the 'To Date' calendar icon the month displayed in the list select should be October not September.

    How can this be achieved?

    It can be done with dynamic action of executing JavaScript Code. I'd like to think that there is a better way to do it than that, which basically extract the picker of the year and month, then rewrites the JS code that triggers the date picker To use them as parameters month and year.

    Dynamic action

    Event: Mouse enter

    Selection type: jQuery Selector

    jQuery Selector: #P1_TO_IMG

    Real Actions

    Action: Run the JavaScript Code

    Fire on Page load: NO.

    Code:

    var from, d, y, m, button, href, js, p;
    
    from = $v('P1_FROM');
    
    if (from) {
      d = new Date(from);
      y = d.getUTCFullYear().toString();
      m = (d.getUTCMonth() + 1).toString();
    
      button = $('#P1_TO_fieldset.datepicker a');
      href = button.attr('href');
      js = href.match(/^(javascript:void\(\$p_DatePicker\()(.+)(\)\);$)/);
      p = js[2].split(',');
    
      p[8]  = "'" + y + "'";
      p[13] = "'" + ((m.length === 1) ? "0" + m : m) + "'";
    
      href = js[1].concat(p.join(), js[3]);
      console.log(href);
      button.attr('href', href);
    }
    

    Replace P1_FROM and P1_TO with the names of your items as needed.

  • TO_CHAR fucntion problem with dates.

    Hi all

    I tested the following problem with 10g and 11g databases, and the problem is the same.

    create table aa (a date);
      insert into aa values('23-Mar-2014');
     commit;
    

    now the following query gives no results

    select count(*) from aa
    where to_char(a,'dd-Mon-yyyy') >='23-MAR-2014' and to_char(a,'dd-Mon-yyyy') <='23-Apr-2014';
    COUNT(*)
    ----------
     0
    

    and the following query gives the results

    select count(*) from aa
    where a>='23-Mar-2014' and a<='23-Apr-2014'
    
    COUNT(*)
    ----------
      1
    

    Why?

    We need the to_char working for our criteria of search dot net application.

    kindly guide us.

    Thank you

    You're hurting. Why convert a date into a string of characters and try to compare it to another string? This is false.

    Insert into aa values('23-Mar-2014');

    should be

    insert into aa values (to_date (March 23, 2014 ',' MON-DD-YYYY "");)

    and your selection should be:

    Select count (*) in aa

    where a > = to_date (March 23, 2014 ',' MON-DD-YYYY') and to_date (April 23, 2014 ',' MON-DD-YYYY "")

  • Problem with date settings

    Hi all. I have the problem with the Sub statement


    SELECT THE DOUBLE TO_DATE(:P_DATE,'DD/MM/YY')

    it get me ' 10 / 04/2012 '

    but I want 10/04/12 not as above.

    I saw that DD/MM/YY not like 'DD/MM/YYYY' still it gives me 10/04/2012 why can someone explain?

    Kind regards
    Uraja

    To_Date will always give you the output date format-based nls...

    Instead, you can try

    SELECT to_char (TO_DATE(:P_DATE,'DD/MM/YY'), ' DD/MM/YY') FROM DUAL;

    or replace nls_Date_format jj/mm/aa

  • Problem with Date calc

    I am trying to get this FormCalc calculation to work:

    Date2Num (form1. Page1_SF. EffectDates.endDate, ' DD/MM/YYYY') - Date2Num (form1. Page1_SF. EffectDates.startDate, "DD/MM/YYYY")

    Evently, I will divide by 7 to get the number of weeks, but the initial calculation won't work after the dates entered.

    Can you tell me what the problem with my forumula?

    Thank you.

    Odd. Something strange on the Date2Num format. I changed them in the calculation for "YYYY-MM-DD" and it works. Note that this is the calculation of the number of days elapsed.

    If (HasValue (form1. Page1_SF. EffectDates.endDate) & HasValue (form1. Page1_SF. EffectDates.startDate)) then
    $.rawValue = Date2Num (form1. Page1_SF. EffectDates.endDate.rawValue, 'YYYY-MM-DD') - Date2Num (form1. Page1_SF. EffectDates.startDate.rawValue, "YYYY-MM-DD")
    on the other
    $.rawValue = null
    endif
    Steve
  • problems with DATE

    Hello

    I have the following plsql:
    DECLARE
       TYPE record_t
       IS
          RECORD (
             col_1    DATE,
             col_2   VARCHAR2 (7),
             col_3    VARCHAR2 (1)
          );
    
       l_record    record_t;
       l_ref_cur   dyn_fetch.ref_cur_t;
    BEGIN
       l_ref_cur := helper.ref_cur;
    
       LOOP
          FETCH l_ref_cur INTO   l_record;
    
          EXIT WHEN l_ref_cur%NOTFOUND;
    
          ELSIF (LOWER (l_record.col_3) = 'd')
          THEN
             DELETE FROM  table_new
                   WHERE   MY_DATE = TO_DATE (l_record.col_1);
    
             DBMS_OUTPUT.put_line ('here it is: ' || l_record.col_1);
          END IF;
       END LOOP;
    
       CLOSE l_ref_cur;
    END;
    So, the problem is, that 'L_RECORD. COL_1"returns dates in the form: jj. MM YY

    It works very well with most of the files, but it does not find the file with date = 15.08.1930. Then I l_record.col_1 = 15.08.30! Maybe the problem is that oracle is not sure if she should return * 1930 or 2030 *...

    So, how can I solve this problem, I want to return the l_record.col_1 * 15.08.1930 *, NOT 15.08.30!

    Should I change the definition of the record_t type?

    Thank you!

    Your record definition defines COL_1 as a date, so there is not need to convert a date value in this column.

    Remove the TO_DATE() function inside the loop.

  • Problem with date comparison

    I have a problem with the TO_YMINTERVAL('10-00') function.


    Thank you
    Bachan.

    Published by: bah on March 23, 2010 14:47

    Please do not double post.
    Problem with TO_YMINTERVAL('10-00') function.

    Stick to your original thread, as others have already tried to help you.
    Start a new thread on the same topic is a waiste of time, as already provided entries are lost to other readers...

  • Problem with data services blackBerry Smartphones

    I want to use internet on my phone that by wifi, so obviosly I disabled data on implemented mobile network services. Problem is when I'm home or anywhere where I can connect to a wifi network, I get a message saying that there is no problem, and if it persists, I must contact my provider. I'm something wrong, is the solution?

    For some strange reason, you can now navigate with your data disabled Services.  It is a new feature in OS 7 (or 7.1, I don't remember which operating system, it has been introduced).  There was a time where you need to Data Services is enabled for surfing, even just with a Wi - Fi.

    However, I am happy that things are working for you now.

  • Facing problem with date and time.

    * - Original title - BIOS

    Mr President.

    I have Compaq CQ2100IL Desktop pc for awhile I was faced with the problem of the date and time, so I posted this question to Microsoft, so they gave me a solution change my CMOS battery, so I did it, but despite this I get this error again then I tried and got answer to update my BIOS , I tried to find a version update on the HP site but did not find, so please help me in this matter.

    Hi Vikas,

    You can contact HP here: http://h10025.www1.hp.com/ewfrf/wc/contacthp?cc=us&dlc=en&lc=en&os=4062&product=3890751&sw_lang=

    Warning in the BIOS: BIOS change / semiconductor (CMOS) to complementary metal oxide settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk.

    Let us know if you need assistance with any windows problem. We will be happy to help you.

  • Problem with data type 'Date' in Hyperion Planning V11.1.2.2

    Hello

    I created members with the date data type. However when I save the date, it disappears or comes up with a random date? One has encountered such a problem before?

    If so can you share the fix.

    Thanks in advance for your help.

    See you soon,.

    XXX

    Hello

    This problem is related to you not having is not a coherent framework for your type of date entry.

    So, go to the administration of the application and define the date format DD/MM/YYYY in the application settings and display options, under current default application settings. Then after doing that as a user, go to user preferences and display options and the date format, select the same. Or delete automatically detect them.

    I've seen this behavior if you detect automatically on the user's preferences

    Thank you

    Anthony

  • Problem with date in the canonical format

    Hi all

    I have a test with the sql data source:
    Select sysdate double;

    The result is the BI Publisher
    <ROWSET>
      <ROW>
        <SYSDATE>2009-05-07T14:56:19.000+02:00</SYSDATE>
      </ROW>
    </ROWSET>
    that is the date and time for the selection. It displays 14:56:19 as time what exactly is the time that I started the selection.

    Now, I create a template in Word only display the sysdate with parameters field:
    Type: Date
    Format: dd-MMM-yyyy hh: mm:

    and the result is (copied from the PDF):

    07-May-2009 * 12: 56:19 *.

    Any ideas how to solve this problem? It seems to me that the section '+ 02:00 ' to canonical format is interpreted as a modifier in the model...

    Thanks in advance :)
    Wolfgang

    Published by: Wolfgang on 07.05.2009 15:19

    You must set the timezome as

    America/New_York

    By default, it will be GMT.

    The area in which you are?

    There is the function, where you can specify the zone and get this time exactly.

Maybe you are looking for